Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
pylyzer
is a static code analyzer / language server for Python, written in Rust.
pip install pylyzer
cargo install pylyzer --locked
git clone https://github.com/mtshiba/pylyzer.git
cargo install --path . --locked
Make sure that cargo
/rustc
is up-to-date, as pylyzer may be written with the latest (stable) language features.
pylyzer file.py
If you don't specify a file path, pylyzer will automatically search for the entry point.
pylyzer
This option is used when an LSP-aware editor requires arguments to start pylyzer.
pylyzer --server
For other options, check the manual.
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.
While pytype/pyright's error reports are illegible, pylyzer shows where the error occurred and provides clear error messages.
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).
You can install the VSCode extension from the Marketplace or from the command line:
code --install-extension pylyzer.pylyzer
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.
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.
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.
async/await
list
dict
tuple
set
typing
Union
Optional
Literal
Callable
Any
TypeVar
TypedDict
ClassVar
Generic
Protocol
Final
Annotated
TypeAlias
TypeGuard
collections.abc
Collection
Container
Generator
Iterable
Iterator
Mapping
, MutableMapping
Sequence
, MutableSequence
typing.cast
)is
, isinstance
)pyi
(stub) files support# type: ...
)pip
poetry
uv
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.
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.↩
FAQs
A static code analyzer & language server for Python
We found that pylyzer demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.