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.1.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.1-py3-none-any.whl (14.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: lint_utils-0.2.1.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.1.tar.gz
Algorithm Hash digest
SHA256 b7b65639fb083b097ff229f449e31b64fc205b337326dd5c226f4e63dc26a81e
MD5 b1c8d436eb00eac4c98e450fdea5ba03
BLAKE2b-256 63785f86350d3605e17bd35586f9506262ea56148f9b12b0a803c091fa0d1605

See more details on using hashes here.

File details

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

File metadata

  • Download URL: lint_utils-0.2.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8b65f9f54420265b6f28fd1a563a7e14a2ff42ea557e58251351c13d056b6ec4
MD5 d8b106cf0d2d0d2ae8d13f46c8b1ff87
BLAKE2b-256 c7b3c04c30c90c9ee069d9c7476270ecf4455585001eebc17417728d35490869

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