GithubHelp home page GithubHelp logo

pylint_google_style_guide_imports_enforcing's Introduction

How it works?

It marks importing anything but modules/packages as invalid with a message only-importing-modules-is-allowed. This adheres to Google's Python style guide.

An example:

from functools import partial  # invalid
import functools  # valid
from some_module.some_subomdule import SomeClass  # invalid
from some_module import some_subomdule  # valid

Why?

To not force people to manual check if something we imported is a module or not.

How to use it?

After installing a package just run pylint, appending pylint_google_style_guide_imports_enforcing to your --load-plugins option.

An example:

pylint my_cool_project --load-plugins=pylint_google_style_guide_imports_enforcing

or append it to your pylintrc file:

[MASTER]
load-plugins=pylint_google_style_guide_imports_enforcing

pylint_google_style_guide_imports_enforcing's People

Contributors

enforcer avatar ringohoffman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

pylint_google_style_guide_imports_enforcing's Issues

astroid.exceptions.AstroidError with pylint 2.16.1

python version: 3.10.9
pylint version: 2.16.1
pylint_google_style_guide_imports_enforcing version: 1.3.0

I think there is some compatibility problem with those versions.

Traceback (most recent call last):
  File "/Users/hyunholee/.pyenv/versions/data-etl-env/bin/pylint", line 8, in <module>
    sys.exit(run_pylint())
  File "/Users/hyunholee/.pyenv/versions/3.10.9/envs/data-etl-env/lib/python3.10/site-packages/pylint/__init__.py", line 36, in run_pylint
    PylintRun(argv or sys.argv[1:])
  File "/Users/hyunholee/.pyenv/versions/3.10.9/envs/data-etl-env/lib/python3.10/site-packages/pylint/lint/run.py", line 213, in __init__
    linter.check(args)
  File "/Users/hyunholee/.pyenv/versions/3.10.9/envs/data-etl-env/lib/python3.10/site-packages/pylint/lint/pylinter.py", line 681, in check
    check_parallel(
  File "/Users/hyunholee/.pyenv/versions/3.10.9/envs/data-etl-env/lib/python3.10/site-packages/pylint/lint/parallel.py", line 156, in check_parallel
    for (
  File "/Users/hyunholee/.pyenv/versions/3.10.9/lib/python3.10/concurrent/futures/process.py", line 570, in _chain_from_iterable_of_lists
    for element in iterable:
  File "/Users/hyunholee/.pyenv/versions/3.10.9/lib/python3.10/concurrent/futures/_base.py", line 621, in result_iterator
    yield _result_or_cancel(fs.pop())
  File "/Users/hyunholee/.pyenv/versions/3.10.9/lib/python3.10/concurrent/futures/_base.py", line 319, in _result_or_cancel
    return fut.result(timeout)
  File "/Users/hyunholee/.pyenv/versions/3.10.9/lib/python3.10/concurrent/futures/_base.py", line 458, in result
    return self.__get_result()
  File "/Users/hyunholee/.pyenv/versions/3.10.9/lib/python3.10/concurrent/futures/_base.py", line 403, in __get_result
    raise self._exception
astroid.exceptions.AstroidError
error Command failed with exit code 1.

Installing triggers a DEPRECATION warning about "using the legacy 'setup.py install' method"

$ python --version
Python 3.9.5

$ pip --version
pip 22.3.1 from  <some path>/venv39/lib/site-packages/pip (python 3.9)

When I install this package, using

$ pip install pylint-google-style-guide-imports-enforcing==1.3.0

, I get the following deprecation warning:

  DEPRECATION: pylint-google-style-guide-imports-enforcing is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at pypa/pip#8559

This installation still succeeds (for now), though.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.