-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support pyproject.toml configuration (#368)
- Loading branch information
1 parent
9ebbac0
commit e38b416
Showing
24 changed files
with
1,096 additions
and
249 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Configuration | ||
|
||
The preferred way to configure pyanalyze is using the | ||
`pyproject.toml` configuration file: | ||
|
||
```toml | ||
[tool.pyanalyze] | ||
# Paths pyanalyze should check by default | ||
paths = ["my_module/"] | ||
# Paths to import from | ||
import_paths = ["."] | ||
|
||
# Enable or disable some checks | ||
possibly_undefined_name = true | ||
duplicate_dict_key = false | ||
|
||
# But re-enable it for a specific module | ||
[[tool.pyanalyze.overrides]] | ||
module = "my_module.submodule" | ||
duplicate_dict_key = true | ||
``` | ||
|
||
It is recommended to always set the following configuration options: | ||
|
||
* *paths*: A list of paths (relative to the location of the `pyproject.toml` file) that pyanalyze should check by default. | ||
* *import_paths*: A list of paths (also relative to the configuration file) that pyanalyze should use as roots when trying to import files it is checking. If this is not set, pyanalyze will use entries from `sys.path`, which may produce unexpected results. | ||
|
||
Other supported configuration options are listed below. | ||
|
||
Almost all configuration options can be overridden for individual modules or packages. To set a module-specific configuration, add an entry to the `tool.pyanalyze.overrides` list (as in the example above), and set the `module` key to the fully qualified name of the module or package. | ||
|
||
<!-- TODO figure out a way to dynamically include docs for each option --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.