If you don't specify a file path, pylyzer will automatically search for the entry point.
-pylyzer
+
Start the language server
This option is used when an LSP-aware editor requires arguments to start pylyzer.
-pylyzer --server
+
For other options, check the manual.
What is the advantage over pylint, pyright, pytype, etc.?
@@ -746,7 +765,7 @@

VSCode extension
You can install the VSCode extension from the Marketplace or from the command line:
-code --install-extension pylyzer.pylyzer
+code --install-extension pylyzer.pylyzer
What is the difference from Ruff?
Ruff, like pylyzer, is a static code analysis tool for Python written in Rust, but Ruff is a linter and pylyzer is a type checker & language server.
@@ -841,7 +860,7 @@ This language is a transpiled language that targets Python, and has a static typ
type assertion (typing.cast)
type narrowing (is, isinstance)
pyi (stub) files support
- glob pattern file check
+ glob pattern file check
type comment (# type: ...)
virtual environment support
package manager support
diff --git a/search/search_index.json b/search/search_index.json
index ced2f40..48282d2 100644
--- a/search/search_index.json
+++ b/search/search_index.json
@@ -1 +1 @@
-{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"","title":"pylyzer \u26a1","text":"pylyzer is a static code analyzer / language server for Python, written in Rust.
"},{"location":"#installation","title":"Installation","text":""},{"location":"#pip","title":"pip","text":"
pip install pylyzer\n
"},{"location":"#cargo-rust-package-manager","title":"cargo (Rust package manager)","text":"cargo install pylyzer --locked\n
"},{"location":"#build-from-source","title":"build from source","text":"git clone https://github.com/mtshiba/pylyzer.git\ncargo install --path . --locked\n
Make sure that cargo/rustc is up-to-date, as pylyzer may be written with the latest (stable) language features.
"},{"location":"#github-releases","title":"GitHub Releases","text":""},{"location":"#how-to-use","title":"How to use","text":""},{"location":"#check-a-single-file","title":"Check a single file","text":"pylyzer file.py\n
"},{"location":"#check-an-entire-package","title":"Check an entire package","text":"If you don't specify a file path, pylyzer will automatically search for the entry point.
pylyzer\n
"},{"location":"#start-the-language-server","title":"Start the language server","text":"This option is used when an LSP-aware editor requires arguments to start pylyzer.
pylyzer --server\n
For other options, check the manual.
"},{"location":"#what-is-the-advantage-over-pylint-pyright-pytype-etc","title":"What is the advantage over pylint, pyright, pytype, etc.?","text":" On average, pylyzer can inspect Python scripts more than 100 times faster than pytype and pyright 1. This is largely due to the fact that pylyzer is implemented in Rust.
- Reports readability \ud83d\udcd6
While pytype/pyright's error reports are illegible, pylyzer shows where the error occurred and provides clear error messages.
"},{"location":"#pyright","title":"pyright","text":""},{"location":"#pylyzer_1","title":"pylyzer \ud83d\ude03","text":" - Rich LSP support \ud83d\udcdd
pylyzer as a language server supports various features, such as completion and renaming (The language server is an adaptation of the Erg Language Server (ELS). For more information on the implemented features, please see here).
"},{"location":"#vscode-extension","title":"VSCode extension","text":"You can install the VSCode extension from the Marketplace or from the command line:
code --install-extension pylyzer.pylyzer\n
"},{"location":"#what-is-the-difference-from-ruff","title":"What is the difference from Ruff?","text":"Ruff, like pylyzer, is a static code analysis tool for Python written in Rust, but Ruff is a linter and pylyzer is a type checker & language server. pylyzer does not perform linting & formatting, and Ruff does not perform type checking.
"},{"location":"#how-it-works","title":"How it works","text":"pylyzer uses the type checker of the Erg programming language internally. This language is a transpiled language that targets Python, and has a static type system.
pylyzer converts Python ASTs to Erg ASTs and passes them to Erg's type checker. It then displays the results with appropriate modifications.
"},{"location":"#limitations","title":"Limitations","text":" -
pylyzer's type inspector only assumes (potentially) statically typed code, so you cannot check any code uses reflections, such as exec, setattr, etc.
-
pylyzer (= Erg's type system) has its own type declarations for the Python standard APIs. Typing of all APIs is not complete and may result in an error that such an API does not exist.
-
Since pylyzer's type checking is conservative, you may encounter many (possibly false positive) errors. We are working on fixing this, but if you are concerned about editor errors, please turn off the diagnostics feature.
"},{"location":"#todos","title":"TODOs","text":" - type checking
- variable
- operator
- function/method
- class
-
async/await - user-defined abstract class
- type inference
- variable
- operator
- function/method
- class
- builtin modules analysis
- local scripts analysis
- local packages analysis
- LSP features
- diagnostics
- completion
- rename
- hover
- goto definition
- signature help
- find references
- document symbol
- call hierarchy
- collection types
-
typing -
Union -
Optional -
Literal -
Callable -
Any -
TypeVar -
TypedDict -
ClassVar -
Generic -
Protocol -
Final -
Annotated -
TypeAlias -
TypeGuard - type parameter syntax
- type narrowing
- others
-
collections.abc -
Collection -
Container -
Generator -
Iterable -
Iterator -
Mapping, MutableMapping -
Sequence, MutableSequence - others
- type assertion (
typing.cast) - type narrowing (
is, isinstance) -
pyi (stub) files support - glob pattern file check
- type comment (
# type: ...) - virtual environment support
- package manager support
"},{"location":"#join-us","title":"Join us!","text":"We are looking for contributors to help us improve pylyzer. If you are interested in contributing and have any questions, please feel free to contact us.
- Discord (Erg language)
- GitHub discussions
1 The performance test was conducted on MacBook (Early 2016) with 1.1 GHz Intel Core m3 processor and 8 GB 1867 MHz LPDDR3 memory.\u21a9
"},{"location":"editor/","title":"Editor integrations","text":""},{"location":"editor/#vscode","title":"VSCode","text":""},{"location":"editor/#neovim","title":"Neovim","text":" - Setup mason.
- Type
:MasonInstall pylyzer in Neovim.
If you use LunarVim, no setup is required. Just install pylyzer and you are good to go.
"},{"location":"errors/errors/","title":"Pylyzer-specific errors","text":""},{"location":"errors/errors/#e0001-reassignment-of-a-function-referenced-by-other-functions","title":"E0001: Reassignment of a function referenced by other functions","text":"def g(): return f()\n\ndef f(): return 1\ndef f(): return \"a\" # E0001: Reassignment of a function referenced by other functions\n\nprint(g())\n
"},{"location":"errors/errors/#e0002-__init__-doesnt-have-a-first-parameter-named-self","title":"E0002: __init__ doesn't have a first parameter named self","text":"class C:\n def __init__(a): pass # E0002\n
"},{"location":"errors/errors/#e0003-__init__-as-a-member-variable","title":"E0003: __init__ as a member variable","text":"class C:\n __init__ = 1 # E0003\n
"},{"location":"errors/warns/","title":"Pylyzer-specific warnings","text":""},{"location":"errors/warns/#w0188-used-value","title":"W0188: Used value","text":"def f(x): return x\n\nf(1) # W0188: UnusedWarning: the evaluation result of the expression (: {1, }) is not used\n
"},{"location":"options/options/","title":"command line options","text":""},{"location":"options/options/#-server","title":"--server","text":"Launch as a language server.
"},{"location":"options/options/#-clear-cache","title":"--clear-cache","text":"Clear the cache files.
"},{"location":"options/options/#-dump-decl","title":"--dump-decl","text":"Dump a type declarations file (d.er) after type checking.
$ pylyzer --dump-decl test.py\nStart checking: test.py\nAll checks OK: test.py\n\n$ ls\ntest.py test.d.er\n
"},{"location":"options/options/#-c-code","title":"-c/--code","text":"Check code from the command line.
$ pylyzer -c \"print('hello world')\"\nStart checking: string\nAll checks OK: string\n
"},{"location":"options/options/#-disable","title":"--disable","text":"Disable a default LSP feature. Default (disableable) features are:
- codeAction
- codeLens
- completion
- diagnostics
- findReferences
- gotoDefinition
- hover
- inlayHint
- rename
- semanticTokens
- signatureHelp
- documentLink
"},{"location":"options/options/#-verbose","title":"--verbose","text":"Print process information verbosely.
"},{"location":"options/options/#-no-infer-fn-type","title":"--no-infer-fn-type","text":"When a function type is not specified, no type inference is performed and the function type is assumed to be Any.
"},{"location":"options/options/#-fast-error-report","title":"--fast-error-report","text":"Simplify error reporting by eliminating to search for similar variables when a variable does not exist.
"},{"location":"options/options/#-hurry","title":"--hurry","text":"Enable --no-infer-fn-type and --fast-error-report.
"},{"location":"options/options/#-do-not-show-ext-errors","title":"--do-not-show-ext-errors","text":"Do not show errors from external libraries.
"},{"location":"options/options/#-do-not-respect-pyi","title":"--do-not-respect-pyi","text":"If specified, the actual .py types will be respected over the .pyi types. Applying this option may slow down the analysis.
"},{"location":"options/pyproject/","title":"pyproject.toml options","text":""},{"location":"options/pyproject/#toolpylyzerpythonpath","title":"tool.pylyzer.python.path","text":"Path to the Python interpreter to use. If not set, the default Python interpreter will be used.
[tool.pylyzer.python]\npath = \"path/to/python\"\n
"}]}
\ No newline at end of file
+{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"","title":"pylyzer \u26a1","text":"pylyzer is a static code analyzer / language server for Python, written in Rust.
"},{"location":"#installation","title":"Installation","text":""},{"location":"#pip","title":"pip","text":"pip install pylyzer\n
"},{"location":"#cargo-rust-package-manager","title":"cargo (Rust package manager)","text":"cargo install pylyzer --locked\n
"},{"location":"#build-from-source","title":"build from source","text":"git clone https://github.com/mtshiba/pylyzer.git\ncargo install --path . --locked\n
Make sure that cargo/rustc is up-to-date, as pylyzer may be written with the latest (stable) language features.
"},{"location":"#github-releases","title":"GitHub Releases","text":""},{"location":"#how-to-use","title":"How to use","text":""},{"location":"#check-a-single-file","title":"Check a single file","text":"pylyzer file.py\n
"},{"location":"#check-multiple-files","title":"Check multiple files","text":"# glob patterns are supported\npylyzer file1.py file2.py dir/file*.py\n
"},{"location":"#check-an-entire-package","title":"Check an entire package","text":"If you don't specify a file path, pylyzer will automatically search for the entry point.
pylyzer\n
"},{"location":"#start-the-language-server","title":"Start the language server","text":"This option is used when an LSP-aware editor requires arguments to start pylyzer.
pylyzer --server\n
For other options, check the manual.
"},{"location":"#what-is-the-advantage-over-pylint-pyright-pytype-etc","title":"What is the advantage over pylint, pyright, pytype, etc.?","text":" On average, pylyzer can inspect Python scripts more than 100 times faster than pytype and pyright 1. This is largely due to the fact that pylyzer is implemented in Rust.
- Reports readability \ud83d\udcd6
While pytype/pyright's error reports are illegible, pylyzer shows where the error occurred and provides clear error messages.
"},{"location":"#pyright","title":"pyright","text":""},{"location":"#pylyzer_1","title":"pylyzer \ud83d\ude03","text":" - Rich LSP support \ud83d\udcdd
pylyzer as a language server supports various features, such as completion and renaming (The language server is an adaptation of the Erg Language Server (ELS). For more information on the implemented features, please see here).
"},{"location":"#vscode-extension","title":"VSCode extension","text":"You can install the VSCode extension from the Marketplace or from the command line:
code --install-extension pylyzer.pylyzer\n
"},{"location":"#what-is-the-difference-from-ruff","title":"What is the difference from Ruff?","text":"Ruff, like pylyzer, is a static code analysis tool for Python written in Rust, but Ruff is a linter and pylyzer is a type checker & language server. pylyzer does not perform linting & formatting, and Ruff does not perform type checking.
"},{"location":"#how-it-works","title":"How it works","text":"pylyzer uses the type checker of the Erg programming language internally. This language is a transpiled language that targets Python, and has a static type system.
pylyzer converts Python ASTs to Erg ASTs and passes them to Erg's type checker. It then displays the results with appropriate modifications.
"},{"location":"#limitations","title":"Limitations","text":" -
pylyzer's type inspector only assumes (potentially) statically typed code, so you cannot check any code uses reflections, such as exec, setattr, etc.
-
pylyzer (= Erg's type system) has its own type declarations for the Python standard APIs. Typing of all APIs is not complete and may result in an error that such an API does not exist.
-
Since pylyzer's type checking is conservative, you may encounter many (possibly false positive) errors. We are working on fixing this, but if you are concerned about editor errors, please turn off the diagnostics feature.
"},{"location":"#todos","title":"TODOs","text":" - type checking
- variable
- operator
- function/method
- class
-
async/await - user-defined abstract class
- type inference
- variable
- operator
- function/method
- class
- builtin modules analysis
- local scripts analysis
- local packages analysis
- LSP features
- diagnostics
- completion
- rename
- hover
- goto definition
- signature help
- find references
- document symbol
- call hierarchy
- collection types
-
typing -
Union -
Optional -
Literal -
Callable -
Any -
TypeVar -
TypedDict -
ClassVar -
Generic -
Protocol -
Final -
Annotated -
TypeAlias -
TypeGuard - type parameter syntax
- type narrowing
- others
-
collections.abc -
Collection -
Container -
Generator -
Iterable -
Iterator -
Mapping, MutableMapping -
Sequence, MutableSequence - others
- type assertion (
typing.cast) - type narrowing (
is, isinstance) -
pyi (stub) files support - glob pattern file check
- type comment (
# type: ...) - virtual environment support
- package manager support
"},{"location":"#join-us","title":"Join us!","text":"We are looking for contributors to help us improve pylyzer. If you are interested in contributing and have any questions, please feel free to contact us.
- Discord (Erg language)
- GitHub discussions
1 The performance test was conducted on MacBook (Early 2016) with 1.1 GHz Intel Core m3 processor and 8 GB 1867 MHz LPDDR3 memory.\u21a9
"},{"location":"editor/","title":"Editor integrations","text":""},{"location":"editor/#vscode","title":"VSCode","text":""},{"location":"editor/#neovim","title":"Neovim","text":" - Setup mason.
- Type
:MasonInstall pylyzer in Neovim.
If you use LunarVim, no setup is required. Just install pylyzer and you are good to go.
"},{"location":"errors/errors/","title":"Pylyzer-specific errors","text":""},{"location":"errors/errors/#e0001-reassignment-of-a-function-referenced-by-other-functions","title":"E0001: Reassignment of a function referenced by other functions","text":"def g(): return f()\n\ndef f(): return 1\ndef f(): return \"a\" # E0001: Reassignment of a function referenced by other functions\n\nprint(g())\n
"},{"location":"errors/errors/#e0002-__init__-doesnt-have-a-first-parameter-named-self","title":"E0002: __init__ doesn't have a first parameter named self","text":"class C:\n def __init__(a): pass # E0002\n
"},{"location":"errors/errors/#e0003-__init__-as-a-member-variable","title":"E0003: __init__ as a member variable","text":"class C:\n __init__ = 1 # E0003\n
"},{"location":"errors/warns/","title":"Pylyzer-specific warnings","text":""},{"location":"errors/warns/#w0188-used-value","title":"W0188: Used value","text":"def f(x): return x\n\nf(1) # W0188: UnusedWarning: the evaluation result of the expression (: {1, }) is not used\n
"},{"location":"options/options/","title":"command line options","text":""},{"location":"options/options/#-server","title":"--server","text":"Launch as a language server.
"},{"location":"options/options/#-clear-cache","title":"--clear-cache","text":"Clear the cache files.
"},{"location":"options/options/#-dump-decl","title":"--dump-decl","text":"Dump a type declarations file (d.er) after type checking.
$ pylyzer --dump-decl test.py\nStart checking: test.py\nAll checks OK: test.py\n\n$ ls\ntest.py test.d.er\n
"},{"location":"options/options/#-c-code","title":"-c/--code","text":"Check code from the command line.
$ pylyzer -c \"print('hello world')\"\nStart checking: string\nAll checks OK: string\n
"},{"location":"options/options/#-disable","title":"--disable","text":"Disable a default LSP feature. Default (disableable) features are:
- codeAction
- codeLens
- completion
- diagnostics
- findReferences
- gotoDefinition
- hover
- inlayHint
- rename
- semanticTokens
- signatureHelp
- documentLink
"},{"location":"options/options/#-verbose","title":"--verbose","text":"Print process information verbosely.
"},{"location":"options/options/#-no-infer-fn-type","title":"--no-infer-fn-type","text":"When a function type is not specified, no type inference is performed and the function type is assumed to be Any.
"},{"location":"options/options/#-fast-error-report","title":"--fast-error-report","text":"Simplify error reporting by eliminating to search for similar variables when a variable does not exist.
"},{"location":"options/options/#-hurry","title":"--hurry","text":"Enable --no-infer-fn-type and --fast-error-report.
"},{"location":"options/options/#-do-not-show-ext-errors","title":"--do-not-show-ext-errors","text":"Do not show errors from external libraries.
"},{"location":"options/options/#-do-not-respect-pyi","title":"--do-not-respect-pyi","text":"If specified, the actual .py types will be respected over the .pyi types. Applying this option may slow down the analysis.
"},{"location":"options/pyproject/","title":"pyproject.toml options","text":""},{"location":"options/pyproject/#toolpylyzerpythonpath","title":"tool.pylyzer.python.path","text":"Path to the Python interpreter to use. If not set, the default Python interpreter will be used.
[tool.pylyzer.python]\npath = \"path/to/python\"\n
"}]}
\ No newline at end of file
diff --git a/sitemap.xml b/sitemap.xml
index 8c69be7..ac3bc0b 100644
--- a/sitemap.xml
+++ b/sitemap.xml
@@ -2,26 +2,26 @@
https://mtshiba.github.io/pylyzer/
- 2025-02-18
+ 2025-02-24
https://mtshiba.github.io/pylyzer/editor/
- 2025-02-18
+ 2025-02-24
https://mtshiba.github.io/pylyzer/errors/errors/
- 2025-02-18
+ 2025-02-24
https://mtshiba.github.io/pylyzer/errors/warns/
- 2025-02-18
+ 2025-02-24
https://mtshiba.github.io/pylyzer/options/options/
- 2025-02-18
+ 2025-02-24
https://mtshiba.github.io/pylyzer/options/pyproject/
- 2025-02-18
+ 2025-02-24
\ No newline at end of file
diff --git a/sitemap.xml.gz b/sitemap.xml.gz
index ca5ecd2..4385b41 100644
Binary files a/sitemap.xml.gz and b/sitemap.xml.gz differ