Skip to main content

Pylint plugin which adds linter error for relatives imports.Read more about imports at https://peps.python.org/pep-0008/#imports

Project description

Pylint force absolute imports plugin

What for?

Following PEP8 recommendation about imports, import statements should be absolute :

Standard library code should avoid complex package layouts and always use absolute imports.

# project/
# |---- __init__.py
# |---- employee.py

from .employee import Employee  # <- BAD
from project.employee import Employee  # <- Good

Installation

pip install pylint_absolute_imports

Usage

In pylint.rc:

[MASTER]
load-plugins=pylint_absolute_imports

Or, in terminal:

pylint --load-plugins pylint_absolute_imports foo.py

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

pylint_absolute_imports-1.1.0.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

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

pylint_absolute_imports-1.1.0-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

Details for the file pylint_absolute_imports-1.1.0.tar.gz.

File metadata

  • Download URL: pylint_absolute_imports-1.1.0.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.0

File hashes

Hashes for pylint_absolute_imports-1.1.0.tar.gz
Algorithm Hash digest
SHA256 3ea2bb868626c4662b76cb84d541af4e4cc4a355872fa28def72ad4439b31717
MD5 8d4eb10c9862b0f0c6bb214f5bcf375b
BLAKE2b-256 b92890a1e9abc2ad009d5ae2899bf19b55c97ec6fd71c6a849af429f54d552e7

See more details on using hashes here.

File details

Details for the file pylint_absolute_imports-1.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pylint_absolute_imports-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3fa7b73481c50cb7e7892d5eeaecf8108ad0ed06d9a545b5c620d20250a1f727
MD5 781b78e6787301596955ea91d4847462
BLAKE2b-256 e658dcb5694dd51a4cba799dff0951024e2fdc24cf9b51c90c2f16c5b89a5d66

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