Skip to main content

Flake8 plugin that checks for forbidden imports in your code

Project description

Flake8 Import Linter

Flake8 plugin that checks for forbidden imports in your code

It works for both python2 and python3 since it only uses ast and configparser libraries :)

Usage

  1. flake8 config

    add "flake8_import_linter" section

    add "forbidden_modules" config - (comma separeted, one line, without " and ' )

    example:

    [flake8_import_linter]

    forbidden_modules = pytest, unittest

  2. run flake8 as always

    flake8 .

  3. if a forbidden module is detected, flake8 will show:

    IMP100 forbidden import

ENJOY!

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

flake8_import_linter-0.1.8.tar.gz (2.9 kB view details)

Uploaded Source

File details

Details for the file flake8_import_linter-0.1.8.tar.gz.

File metadata

  • Download URL: flake8_import_linter-0.1.8.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.8.3 requests/2.27.1 setuptools/44.1.1 requests-toolbelt/1.0.0 tqdm/4.64.1 CPython/2.7.18

File hashes

Hashes for flake8_import_linter-0.1.8.tar.gz
Algorithm Hash digest
SHA256 a1a93365c622bdcddbdaf6d1ee26c52bfe99dc6f48ae4a147dd4ad67040eebd8
MD5 55ee18073d3ff1074cc438e385c18d7e
BLAKE2b-256 7c73d44160fb183c7df351a0495a72a81a7c3577e9f4bbe4804b485844153fd4

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