Giter Site home page Giter Site logo

autohooks-plugin-pylint's Introduction

Greenbone Logo

autohooks-plugin-pylint

PyPI release

An autohooks plugin for python code linting via pylint.

Installation

Install using pip

You can install the latest stable release of autohooks-plugin-pylint from the Python Package Index using pip:

python3 -m pip install autohooks-plugin-pylint

Install using poetry

It is highly encouraged to use poetry for maintaining your project's dependencies. Normally autohooks-plugin-pylint is installed as a development dependency.

poetry install

Usage

To activate the pylint autohooks plugin please add the following setting to your pyproject.toml file.

[tool.autohooks]
pre-commit = ["autohooks.plugins.pylint"]

By default, autohooks plugin pylint checks all files with a .py ending. If only files in a sub-directory or files with different endings should be formatted, just add the following setting:

[tool.autohooks]
pre-commit = ["autohooks.plugins.pylint"]

[tool.autohooks.plugins.pylint]
include = ['foo/*.py', '*.foo']

By default, autohooks plugin pylint executes pylint without any arguments and pylint settings are loaded from the .pylintrc file in the root directory of git repository. To change specific settings or to define a different pylint rc file the following plugin configuration can be used:

[tool.autohooks]
pre-commit = ["autohooks.plugins.pylint"]

[tool.autohooks.plugins.pylint]
arguments = ["--rcfile=/path/to/pylintrc", "-s", "n"]

Maintainer

This project is maintained by Greenbone AG.

Contributing

Your contributions are highly appreciated. Please create a pull request on GitHub. Bigger changes need to be discussed with the development team via the issues section at GitHub first.

License

Copyright (C) 2019 - 2023 Greenbone AG

Licensed under the GNU General Public License v3.0 or later.

autohooks-plugin-pylint's People

Contributors

bjoernricks avatar dependabot-preview[bot] avatar dependabot[bot] avatar gabrielschowegreenbone avatar greenbonebot avatar lhhong avatar nichtsfrei avatar pascalholthaus avatar tacire avatar wiegandm avatar y0urself avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

autohooks-plugin-pylint's Issues

How I can ignore the test folder?

I'm trying to ignore a test folder that is present in the root of the project, however, pylint is completely ignoring the settings file and pyproject.toml

pyproject.toml

[tool.autohooks.plugins.pylint]
arguments = ["--rcfile=.pylintrc", '-sn']

.pylintrc
ignore-paths=tests

stdout

ℹ autohooks => pre-commit
     ℹ Running autohooks.plugins.black
         ✓ Running black on tests/test_app_scheduler.py
     ℹ Running autohooks.plugins.pylint
         × Linting error(s) found in tests/test_app_scheduler.py:
         tests/test_app_scheduler.py:1:0: C0114: Missing module docstring (missing-module-docstring)
         tests/test_app_scheduler.py:4:0: C0116: Missing function or method docstring (missing-function-docstring)

Plugin could be faster

Expected behavior

Same speed as if I was running pylint with commited files as arguments.

Current behavior

Very slow, as the plugin rerun the pylint command for every single commited file.

Steps to reproduce

  1. Run pylint on a directory and measure time.
  2. Commit all the files from the directory, with autohooks-plugin-pylint check and measure time.
  3. Compare times of 1. and 2. : 2. is far longer than 1.

Would you consider to add files as arguments to a single run of pylint to speed up the commit time ?

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.