A small, fast, AST-based Python linter with zero runtime dependencies.
Project description
mopper
A lightweight Python linter built on the standard library's ast module, with zero runtime dependencies.
mopper doesn't aim to replace tools like Flake8 or Pylint. Instead, it focuses on a small set of practical checks that catch common mistakes such as unused imports, mutable default arguments, bare except clauses, unreachable code, and more.
Installation
pip install mopper
Usage
mopper path/to/file.py
mopper path/to/project/
mopper . --select B001,B003
mopper . --format json
Rules
| Code | Check |
|---|---|
| B001 | Unused import |
| B002 | Bare except clause |
| B003 | Mutable default argument |
| B004 | Comparing to None, True, or False with == instead of is |
| B005 | Unreachable code after return, raise, break, or continue |
| B006 | Line longer than 100 characters |
Why mopper?
mopper was built from scratch to understand how Python static analysis works internally using only the standard library. It demonstrates how a practical linter can be implemented with ast.NodeVisitor and a simple, extensible rule system.
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mopper-0.1.1.tar.gz.
File metadata
- Download URL: mopper-0.1.1.tar.gz
- Upload date:
- Size: 6.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
090aad9c708f0b46fead5578d4a236b751275c1a28d114f4ffc737a40f5aa0b9
|
|
| MD5 |
7eff1bb12bcd50a475371c043e1ebf0e
|
|
| BLAKE2b-256 |
d10452f0a9b9375661b3e5f5e9b9b1ee4c62bec8081661408f0363ce9cf18d54
|
File details
Details for the file mopper-0.1.1-py3-none-any.whl.
File metadata
- Download URL: mopper-0.1.1-py3-none-any.whl
- Upload date:
- Size: 8.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b1859bad184d8e77d1025a0b0c39ee2b0fb3bde99f534eb8ae1b738271cffcb6
|
|
| MD5 |
79b7af7041e96a68e291dbb1844cb355
|
|
| BLAKE2b-256 |
625234f0ce8f2ad36e1b4d25f6c7422be636fd990784d9b6060535eeeeeb5d7e
|