--- id: cython-lint version: "0.21.0" license: unclear license_treatment: permissive maintenance: active --- # cython-lint — Lint Cython files License: permissive · Maintenance: active · Downloads: 859.6K/mo ## What it is and what it does cython-lint is a static analysis tool that checks Cython (.pyx) files for code quality issues, unused imports, undefined variables, style violations, and Cython-specific problems. It combines pycodestyle checks with custom rules for patterns that are particularly error-prone in Cython code—such as dangerous default values, late-binding closures, and repeated dict keys—and can be run from the command line or integrated into pre-commit workflows. The tool is designed to catch issues that flake8 historically missed in Cython files. It supports configuration via command-line arguments or a `.cython-lint.toml` / `pyproject.toml` file, allows selective rule ignoring, and includes an automated fixer for quote normalization. Its runtime dependencies are minimal and well-established (cython, pycodestyle, tokenize-rt, tomli), making it straightforward to integrate into existing Python development environments. Use it for: - Enforce code quality standards in Cython-heavy projects like NumPy, pandas, or scikit-learn before commits. - Catch unused imports and variables in Cython modules during CI/CD pipelines via pre-commit hooks. - Identify Cython-specific anti-patterns (late-binding closures, dangerous defaults) that pure Python linters miss. - Normalize quote style in Cython files across a project using the double-quote-cython-strings fixer. - Configure project-wide linting rules in pyproject.toml to maintain consistent Cython code style. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. A linter for Cython files that checks for common errors, style issues, and code quality problems using pycodestyle rules and Cython-specific checks, with support for pre-commit hooks and automated fixes. Yes. cython-lint is actively maintained, has low install friction, carries no security vulnerabilities, and is widely adopted by major scientific Python projects. If you work with Cython code, it fills a real gap that general Python linters leave open. The permissive MIT license removes any legal concern. Install it if you want to catch Cython-specific bugs and style issues early. ## Install pip install cython-lint uv add cython-lint poetry add cython-lint ## Installing cython-lint Before you install: Low friction install with four straightforward runtime dependencies (cython, pycodestyle, tokenize-rt, tomli). Actively maintained with recent releases; last commit was 2026-08-10 and the project is not archived. License in practice: Licensed under MIT (permissive), so you can use, modify, and distribute this package freely in both open-source and commercial projects without significant legal restrictions. Quickstart: pip install cython-lint # Command-line usage cython-lint my_file.pyx # Or configure in .pre-commit-config.yaml: # - repo: https://github.com/MarcoGorelli/cython-lint # rev: v0.21.0 # hooks: # - id: cython-lint Requires Python 3.10 or later. Verify before relying: - Whether the tool's Cython-specific checks cover all common pitfalls in production codebases, or if gaps remain. - Performance characteristics when linting large Cython projects with many files. - How well the automated fixer (double-quote-cython-strings) integrates with other formatters like black. ## Package facts - License: not declared (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 859.6K/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags cython linter, lint cython files, cython code quality, cython pre-commit hook, cython style checker, cython error detection, cython pyx linter, cython, linting, pre-commit [View on SkillFed](https://skillfed.io/packages/cython-lint) · [View on PyPI](https://pypi.org/project/cython-lint/)