Skip to main content

A small, fast, AST-based Python linter with zero runtime dependencies.

Project description

mopper

PyPI Python License CI

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mopper-0.1.1.tar.gz (6.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mopper-0.1.1-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

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

Hashes for mopper-0.1.1.tar.gz
Algorithm Hash digest
SHA256 090aad9c708f0b46fead5578d4a236b751275c1a28d114f4ffc737a40f5aa0b9
MD5 7eff1bb12bcd50a475371c043e1ebf0e
BLAKE2b-256 d10452f0a9b9375661b3e5f5e9b9b1ee4c62bec8081661408f0363ce9cf18d54

See more details on using hashes here.

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

Hashes for mopper-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b1859bad184d8e77d1025a0b0c39ee2b0fb3bde99f534eb8ae1b738271cffcb6
MD5 79b7af7041e96a68e291dbb1844cb355
BLAKE2b-256 625234f0ce8f2ad36e1b4d25f6c7422be636fd990784d9b6060535eeeeeb5d7e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page