From 294cc3d12c5f77f60bdc6a51cf8c3a2ced632397 Mon Sep 17 00:00:00 2001 From: Eric Traut Date: Thu, 26 Sep 2019 19:38:48 -0700 Subject: [PATCH] Fixed some typos in documentation. --- README.md | 2 +- docs/command-line.md | 2 +- docs/comments.md | 2 +- docs/configuration.md | 6 +++--- docs/import-resolution.md | 2 +- docs/type-stubs.md | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index bba6afd5a..09513ccf3 100644 --- a/README.md +++ b/README.md @@ -87,7 +87,7 @@ Pyright currently provides support for Python 3.0 and newer. There is currently ## FAQ **Q:** What is the difference between pyright and the [Microsoft Python Visual Studio Code plugin](https://github.com/Microsoft/vscode-python)? -**A:** Pyright is focused on type checking. The Python VS Code plugin is Microsoft’s officially-supported extension for VS Code and provides a diverse array of features including debugging, test case management, linter plugins, and more. Pyright can be used alongide the Microsoft Python extension. +**A:** Pyright is focused on type checking. The Python VS Code plugin is Microsoft’s officially-supported extension for VS Code and provides a diverse array of features including debugging, test case management, linter plugins, and more. Pyright can be used alongside the Microsoft Python extension. **Q:** What is the long-term plan for Pyright? diff --git a/docs/command-line.md b/docs/command-line.md index b6f8354e7..5ff92ae73 100644 --- a/docs/command-line.md +++ b/docs/command-line.md @@ -5,7 +5,7 @@ Pyright can be run as either a VS Code extension or as a node-based command-line | Flag | Description | | :--------------------------------- | :--------------------------------------------------- | | --createstub IMPORT | Create type stub file(s) for import | -| --dependencies | Emit import dependecy information | +| --dependencies | Emit import dependency information | | -h, --help | Show help message | | -p, --project FILE OR DIRECTORY | Use the configuration file at this location | | --stats | Print detailed performance stats | diff --git a/docs/comments.md b/docs/comments.md index 7ac2ccd8b..4432c5419 100644 --- a/docs/comments.md +++ b/docs/comments.md @@ -3,7 +3,7 @@ Some behaviors of pyright can be controlled through the use of comments within the source file. ## Type Annotations -Verisons of Python prior to 3.6 did not support type annotations for variables. Pyright honors type annotations found within a comment at the end of the same line where a variable is assigned. +Versions of Python prior to 3.6 did not support type annotations for variables. Pyright honors type annotations found within a comment at the end of the same line where a variable is assigned. ``` offsets = [] # type: List[int] diff --git a/docs/configuration.md b/docs/configuration.md index 87cec2c8e..cc6bd24b0 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -20,7 +20,7 @@ Pyright offers flexible configuration options specified in a JSON-formatted text **venv** [string, optional]: Used in conjunction with the venvPath, specifies the virtual environment to use. Individual execution environments may override this setting. -**pythonVersion** [string, optional]: Specifies the version of Python that will be used to execute the source code. The version should be specified as a string in the format "M.m" where M is the major version and m is the minor (e.g. `"3.0"` or `"3.6"`). If a version is provided, pyright will generate errors if the source code makes use of language features that are not supported in that version. It will also tailor its use of type stub files, which conditionalize type definitions based on the version. +**pythonVersion** [string, optional]: Specifies the version of Python that will be used to execute the source code. The version should be specified as a string in the format "M.m" where M is the major version and m is the minor (e.g. `"3.0"` or `"3.6"`). If a version is provided, pyright will generate errors if the source code makes use of language features that are not supported in that version. It will also tailor its use of type stub files, which conditionalizes type definitions based on the version. **pythonPlatform** [string, optional]: Specifies the target platform that will be used to execute the source code. Should be one of `"Windows"`, `"Darwin"` or `"Linux"`. If specified, pyright will tailor its use of type stub files, which conditionalize type definitions based on the platform. @@ -28,7 +28,7 @@ Pyright offers flexible configuration options specified in a JSON-formatted text ## Type Check Diagnostics Settings -The following settings control pyright's diagnostic output (warnings or errors). Unless otherwise specified, each diagnostic setting can specify a boolean value (`false` indicating that no error is generated and `true` indicating that an error is generated). Alternatively, a string value of `"none"`, `"warning"`, or `"error"` can be used to specify the diagnostic level. +The following settings control pyright’s diagnostic output (warnings or errors). Unless otherwise specified, each diagnostic setting can specify a boolean value (`false` indicating that no error is generated and `true` indicating that an error is generated). Alternatively, a string value of `"none"`, `"warning"`, or `"error"` can be used to specify the diagnostic level. **strictListInference** [boolean]: When inferring the type of a list, use strict type assumptions. For example, the expression `[1, 'a', 3.4]` could be inferred to be of type `List[Any]` or `List[Union[int, str, float]]`. If this setting is true, it will use the latter (stricter) type. The default value for this setting is 'false'. @@ -76,7 +76,7 @@ The following settings control pyright's diagnostic output (warnings or errors). **reportConstantRedefinition** [boolean or string, optional]: Generate or suppress diagnostics for attempts to redefine variables whose names are all-caps with underscores and numerals. The default value for this setting is 'none'. -**reportIncompatibleMethodOverride** [boolean or string, optional]: Generate or suppress diagnostics for methods that override a method of the same name in a base class in an incompatible manner (different number of parameters, different parameter tyeps, or a different return type). The default value for this setting is 'none'. +**reportIncompatibleMethodOverride** [boolean or string, optional]: Generate or suppress diagnostics for methods that override a method of the same name in a base class in an incompatible manner (different number of parameters, different parameter types, or a different return type). The default value for this setting is 'none'. **reportInvalidStringEscapeSequence** [boolean or string, optional]: Generate or suppress diagnostics for invalid escape sequences used within string literals. The Python specification indicates that such sequences will generate a syntax error in future versions. The default value for this setting is 'warning'. diff --git a/docs/import-resolution.md b/docs/import-resolution.md index b659b347a..dc3a0a5c8 100644 --- a/docs/import-resolution.md +++ b/docs/import-resolution.md @@ -2,7 +2,7 @@ Pyright resolves external imports based on several configuration settings. If a venvPath and venv are specified, these are used to locate the `site-packages` directory within the virtual environment. -If no venvPath is specified, Pyright falls back to the paths found in the default python interpreter’s search paths (or the python intpreter pointed to by the “python.pythonPath” setting in VS Code). Only directory-based paths are supported (as opposed to zip files or other loader packages). +If no venvPath is specified, Pyright falls back to the paths found in the default python interpreter’s search paths (or the python interpreter pointed to by the “python.pythonPath” setting in VS Code). Only directory-based paths are supported (as opposed to zip files or other loader packages). The Pyright configuration file supports “execution environment” definitions, each of which can define additional paths. These are searched in addition to the venv or PYTHONPATH directories. diff --git a/docs/type-stubs.md b/docs/type-stubs.md index 0ea348124..c77d63462 100644 --- a/docs/type-stubs.md +++ b/docs/type-stubs.md @@ -19,7 +19,7 @@ If you’re serious about static type checking for your Python source base, it ## Generating Type Stubs If you use only a few classes, methods or functions within a library, writing a type stub file by hand is feasible. For large libraries, this can become tedious and error-prone. Pyright can generate “draft” versions of type stub files for you. -To generate a type stub file from within VS Code, enable the “reportreportMissingTypeStubs” setting in your pyrightconfig.json file or by adding a comment `# pyright: reportMissingTypeStubs=true` to individual source files. Make sure you have the target library installed in the python environment that pyright is configued to use for import resolution. Optionally specify a “typingsPath” in your pyrightconfig.json file. This is where pyright will generate your type stub files. By default, the typingsPath is set to "./typings". +To generate a type stub file from within VS Code, enable the reportMissingTypeStubs” setting in your pyrightconfig.json file or by adding a comment `# pyright: reportMissingTypeStubs=true` to individual source files. Make sure you have the target library installed in the python environment that pyright is configured to use for import resolution. Optionally specify a “typingsPath” in your pyrightconfig.json file. This is where pyright will generate your type stub files. By default, the typingsPath is set to "./typings". ### Generating Type Stubs in VS Code If “reportMissingTypeStubs” is enabled, pyright will highlight any imports that have no type stub. Hover over the error message, and you will see a “Quick Fix” link. Clicking on this link will reveal a popup menu item titled “Create Type Stub For XXX”. The example below shows a missing typestub for the `django` library.