Skip to main content

The humble linter package

Project description

Lint Utils

The humble linter package

Installation

pip install lint-utils

Usage

lu check src

or

lu check path/to/file_1.py path/to/file_2/ path/to/dir

Aliases

short alias: lu check ...

full alias lint-utils check ...

Rules

USL001 - Unused object class fields found

RL001 - The reminder has expired

Please enter a comment in the format "# lu: RL001[YYYY-MM-DD]: write a note here

class Command:
    async def execute(self) -> int:
        return 3  # lu: RL001[2025-07-30]: fix later

Configuration

You can create lint_utils.toml in root project directory

[lint-utils]
exclude = []
lint.ignore = []

[lint-utils.exclude-base-classes]
USL001 = []

[lint-utils.exclude-classes]
USL001 = []

pyproject.toml is also supported

...

[tool.lint-utils]
exclude = []
lint.ignore = []

[tool.lint-utils.exclude-base-classes]
USL001 = []

[tool.lint-utils.exclude-classes]
USL001 = []

exclude

If you put a file path in the exclude list, it will be ignored during checking.

...

[tool.lint-utils]
exclude = ["path/to/file.py"]

tool.lint-utils.exclude-base-classes

If you add a base class, it and its child classes will be ignored during validation.

...

[tool.lint-utils.exclude-base-classes]
USL001 = ["Exception"]

Example:

# src/exceptions.py
class FieldNameError(Exception):
    def __init__(self, field_name: str) -> None:
        self._field_name = field_name

This file will be ignored if USL001 rules are followed, because Exception class putted in tool.lint-utils.exclude-base-classes

tool.lint-utils.exclude-classes

If you add a class, it will be ignored during validation.

...

[tool.lint-utils.exclude-classes]
USL001 = ["FieldNameError"]

Example:

# src/exceptions.py
class FieldNameError(Exception):
    def __init__(self, field_name: str) -> None:
        self._field_name = field_name

This file will be ignored, because FieldNameError class putted in lint.exclude_classes for USL001 rule

lint.ignore

If you add a rule code, it will be ignored during validation.

...

[tool.lint-utils]
lint.ignore = ["USL001"]

Line ignoring

In order not to conflict with Ruff and noqa, it was decided to specify the following design:

class CommandCommand:
    def __init__(self, variable: str) -> None:
        self._variable = variable  # lu: USL001

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

lint_utils-0.2.0.tar.gz (9.0 kB view details)

Uploaded Source

Built Distribution

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

lint_utils-0.2.0-py3-none-any.whl (14.2 kB view details)

Uploaded Python 3

File details

Details for the file lint_utils-0.2.0.tar.gz.

File metadata

  • Download URL: lint_utils-0.2.0.tar.gz
  • Upload date:
  • Size: 9.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.0

File hashes

Hashes for lint_utils-0.2.0.tar.gz
Algorithm Hash digest
SHA256 a571a871a66275c131e413f25be4b7e0a9c52e3af8d88122b2bc883985735525
MD5 1761fe15b6ca78e8ab6b29dfb6d593a2
BLAKE2b-256 4b8232e5c6799a95308bb8576fa0b285f155c4da9dbeb6d9ddceab1937b37ad7

See more details on using hashes here.

File details

Details for the file lint_utils-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: lint_utils-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 14.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.0

File hashes

Hashes for lint_utils-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0a94960078b2073866a795d29fe76b6ed4e9223c26ebb0bb8edfca1cbacb480b
MD5 be9bb1407d09ca778153220cf617344d
BLAKE2b-256 835ff20ed3453e0cd73d9fcb55c62901b85890a58d24cc600e33d4b908b263b7

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