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

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.1.11.tar.gz (7.5 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.1.11-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: lint_utils-0.1.11.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.7.3

File hashes

Hashes for lint_utils-0.1.11.tar.gz
Algorithm Hash digest
SHA256 d2f4e3b1584d2b6cfec23e66ebb7a297786dc3d4bf7ea6433fb5677144dc1dae
MD5 d2b1492c5086efe8333934265919c40c
BLAKE2b-256 7fd80cacdf24aa60e436155313ed605a009a7530fd1ffbd344e372fbec3a4ce0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lint_utils-0.1.11-py3-none-any.whl
Algorithm Hash digest
SHA256 4f18350c5fce6371d574a044b9c5c06c9c29d165b251c21fc4653cf0a3b628c0
MD5 c411f8dd43056c428c19f45010c856d4
BLAKE2b-256 05ee10fcf61e8f4cbdfd9fda6e2a58e503abc46b8edc91b7c558fae74775d294

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