Giter VIP home page Giter VIP logo

tidypy's Introduction

https://readthedocs.org/projects/tidypy/badge/?version=latest

This project is no longer actively maintained.

TidyPy is a tool that encapsulates a number of other static analysis tools and makes it easy to configure, execute, and review their results.

  • It's a consolidated tool for performing static analysis on an entire Python project -- not just your *.py source files. In addition to executing a number of different tools on your code, it can also check your YAML, JSON, PO, POT, and RST files.
  • Rather than putting yet another specialized configuration file in your project, TidyPy uses the pyproject.toml file defined by PEP 518. All options for all the tools TidyPy uses are declared in one place, rather than requiring that you configure each tool in a different way.
  • Honors the pseudo-standard # noqa comment in your Python source to easily ignore issues reported by any tool.
  • Includes a number of integrations so you can use it with your favorite toolchain.
  • Includes a variety of reporters that allow you to view or use the results of TidyPy's analysis in whatever way works best for you.
  • Provides a simple API for you to implement your own tool or reporter and include it in the analysis of your project.
  • Supports both Python 2 and 3, as well as PyPy. Even runs on Windows.

When TidyPy is installed (pip install tidypy), the tidypy command should become available in your environment:

$ tidypy --help
Usage: tidypy [OPTIONS] COMMAND [ARGS]...

  A tool that executes several static analysis tools upon a Python project
  and aggregates the results.

Options:
  --version  Show the version and exit.
  --help     Show this message and exit.

Commands:
  check               Executes the tools upon the project files.
  default-config      Outputs a default configuration that can be used to
                      bootstrap your own configuration file.
  extensions          Outputs a listing of all available TidyPy extensions.
  install-vcs         Installs TidyPy as a pre-commit hook into the specified
                      VCS.
  list-codes          Outputs a listing of all known issue codes that tools
                      may report.
  purge-config-cache  Deletes the cache of configurations retrieved from
                      outside the primary configuration.
  remove-vcs          Removes the TidyPy pre-commit hook from the specified
                      VCS.

To have TidyPy analyze your project, use the check subcommand:

$ tidypy check --help
Usage: tidypy check [OPTIONS] [PATH]

  Executes the tools upon the project files.

  Accepts one argument, which is the path to the base of the Python project.
  If not specified, defaults to the current working directory.

Options:
  -x, --exclude REGEX             Specifies a regular expression matched
                                  against paths that you want to exclude from
                                  the examination. Can be specified multiple
                                  times. Overrides the expressions specified
                                  in the configuration file.
  -t, --tool [bandit|dlint|eradicate|jsonlint|manifest|mccabe|polint|pycodestyle|pydiatra|pydocstyle|pyflakes|pylint|pyroma|rstlint|secrets|vulture|yamllint]
                                  Specifies the name of a tool to use during
                                  the examination. Can be specified multiple
                                  times. Overrides the configuration file.
  -r, --report [console,csv,custom,json,null,pycodestyle,pylint,pylint-parseable,toml,yaml][:filename]
                                  Specifies the name of a report to execute
                                  after the examination. Can specify an
                                  optional output file name using the form -r
                                  report:filename. If filename is unset, the
                                  report will be written on stdout. Can be
                                  specified multiple times. Overrides the
                                  configuration file.
  -c, --config FILENAME           Specifies the path to the TidyPy
                                  configuration file to use instead of the
                                  configuration found in the project's
                                  pyproject.toml.
  --workers NUM_WORKERS           The number of workers to use to concurrently
                                  execute the tools. Overrides the
                                  configuration file.
  --disable-merge                 Disable the merging of issues from various
                                  tools when TidyPy considers them equivalent.
                                  Overrides the configuration file.
  --disable-progress              Disable the display of the progress bar.
  --disable-noqa                  Disable the ability to ignore issues using
                                  the "# noqa" comment in Python files.
  --disable-config-cache          Disable the use of the cache when retrieving
                                  configurations referenced by the "extends"
                                  option.
  --help                          Show this message and exit.

If you need to generate a skeleton configuration file with the default options, use the default-config subcommand:

$ tidypy default-config --help
Usage: tidypy default-config [OPTIONS]

  Outputs a default configuration that can be used to bootstrap your own
  configuration file.

Options:
  --pyproject  Output the config so that it can be used in a pyproject.toml
               file.
  --help       Show this message and exit.

If you'd like to see a list of the possible issue codes that could be returned, use the list-codes subcommand:

$ tidypy list-codes --help
Usage: tidypy list-codes [OPTIONS]

  Outputs a listing of all known issue codes that tools may report.

Options:
  -t, --tool [bandit|dlint|eradicate|jsonlint|manifest|mccabe|polint|pycodestyle|pydiatra|pydocstyle|pyflakes|pylint|pyroma|rstlint|secrets|vulture|yamllint]
                                  Specifies the name of a tool whose codes
                                  should be output. If not specified, defaults
                                  to all tools.
  -f, --format [toml|json|yaml|csv]
                                  Specifies the format in which the tools
                                  should be output. If not specified, defaults
                                  to TOML.
  --help                          Show this message and exit.

If you want to install or remove TidyPy as a pre-commit hook in your project's VCS, use the install-vcs/remove-vcs subcommands:

$ tidypy install-vcs --help
Usage: tidypy install-vcs [OPTIONS] VCS [PATH]

  Installs TidyPy as a pre-commit hook into the specified VCS.

  Accepts two arguments:

    VCS: The version control system to install the hook into. Choose from:
    git, hg

    PATH: The path to the base of the repository to install the hook into.
    If not specified, defaults to the current working directory.

Options:
  --strict  Whether or not the hook should prevent the commit if TidyPy finds
            issues.
  --help    Show this message and exit.

$ tidypy remove-vcs --help
Usage: tidypy remove-vcs [OPTIONS] VCS [PATH]

  Removes the TidyPy pre-commit hook from the specified VCS.

  Accepts two arguments:

    VCS: The version control system to remove the hook from. Choose from:
    git, hg

    PATH: The path to the base of the repository to remove the hook from. If
    not specified, defaults to the current working directory.

Options:
  --help  Show this message and exit.

If you'd like to enable bash completion for TidyPy, run the following in your shell (or put it in your bash startup scripts):

$ eval "$(_TIDYPY_COMPLETE=source tidypy)"

If you don't want to install TidyPy locally on your system or in your virtualenv, you can use the published Docker image:

$ docker run --rm --tty --volume=`pwd`:/project tidypy/tidypy

The command above will run tidypy check on the contents of the current directory. If you want to run it on a different directory, then change the `pwd` to whatever path you need (the goal being to mount your project directory to the container's /project volume).

Running TidyPy in this manner has a few limitiations, mostly around the fact that since TidyPy is running in its own, isolated Python environment, tools like pylint won't be able to introspect the packages your project installed locally, so it may report false positives around "import-error", "no-name-in-module", "no-member", etc.

If you want to run a command other than check, just pass that along when you invoke docker:

$ docker run --rm --tty --volume=`pwd`:/project tidypy/tidypy tidypy list-codes

TODO

In addition to ignoring entire files, tools, or specific issue types from tools via your configuration file, you can also use comments in your Python source files to ignore issues on specific lines. Some tools have their own built-in support and notation for doing this:

TidyPy goes beyond these tool-specific flags to implement # noqa on a global scale for Python source files. It will ignore issues for lines that have the # noqa comment, regardless of what tools raise the issues. If you only want to ignore a particular type of issue on a line, you can use syntax like the following:

# noqa: CODE1,CODE2

Or, if a particular code is used in multiple tools, you can specify the exact tool in the comment:

# noqa: pycodestyle:CODE1,pylint:CODE2

Or, if you want to ignore any issue a specific tool raises on a line, you can specify the tool:

# noqa: @pycodestyle,@pylint

You can, of course, mix and match all three notations in a single comment if you need to:

# noqa: CODE1,pylint:CODE2,@pycodestyle

You can disable TidyPy's NOQA behavior by specifying the --disable-noqa option on the command line, or by setting the noqa option to false in your configuration file. A caveat, though: currently pycodestyle and pydocstyle do not respect this option and will always honor any # noqa comments they find.

Out of the box, TidyPy includes support for a number of tools:

pylint
Pylint is a Python source code analyzer which looks for programming errors, helps enforcing a coding standard and sniffs for some code smells.
pycodestyle
pycodestyle is a tool to check your Python code against some of the style conventions in PEP 8.
pydocstyle
pydocstyle is a static analysis tool for checking compliance with Python docstring conventions (e.g., PEP 257).
pyroma
Pyroma tests your project's packaging friendliness.
vulture
Vulture finds unused code in Python programs.
bandit
Bandit is a security linter for Python source code.
eradicate
Eradicate finds commented-out code in Python files.
pyflakes
Pyflakes is a simple program which checks Python source files for errors.
mccabe
Ned Batchelder's script to check the McCabe cyclomatic complexity of Python code.
jsonlint
A part of the demjson package, this tool validates your JSON documents for strict conformance to the JSON specification, and to detect potential data portability issues.
yamllint
The yamllint tool, as its name implies, is a linter for YAML files.
rstlint
The restructuredtext-lint tool, as its name implies, is a linter for reStructuredText files.
polint
A part of the dennis package, this tool lints PO and POT files for problems.
manifest
Uses the check-manifest script to detect discrepancies or problems with your project's MANIFEST.in file.
pydiatra
pydiatra is yet another static checker for Python code.
secrets
The detect-secrets tool attempts to find secrets (keys, passwords, etc) within a code base.
dlint
Dlint is a tool for encouraging best coding practices and helping ensure we're writing secure Python code.

TidyPy includes a number of different methods to present and/or export the results of the analysis of a project. Out of the box, it provides the following:

console
The default reporter. Prints a colored report to the console that groups issues by the file they were found in.
pylint
Prints a report to the console that is in the same format as Pylint's default output.
pylint-parseable
Prints a report to the console that is in roughly the same format as Pylint's "parseable" output.
pycodestyle
Prints a report to the console that is in the same format as pycodestyle's default output.
json
Generates a JSON-serialized object that contains the results of the analysis.
yaml
Generates a YAML-serialized object that contains the results of the analysis.
toml
Generates a TOML-serialized object that contains the results of the analysis.
csv
Generates a set of CSV records that contains the results of the analysis.
custom
Prints ouput to the console that is in the format defined by a template string specified in the project configuration. The template string is expected to be one allowed by the str.format() Python method. It will receive the following arguments: filename, line, character, tool, code, message.

TidyPy includes a handful of plugins/integrations that hook it into other tools.

pytest
TidyPy can be run during execution of your pytest test suite. To enable it, you need to specify --tidypy on the command line when you run pytest, or include it as part of the addopts property in your pytest config.
nose
TidyPy can be run during execution of your nose test suite. To enable it, you can either specify --with-tidypy on the command line when you run nose, or set the with-tidypy property to 1 in your setup.cfg.
pbbt
TidyPy can be included in your PBBT scripts using the tidypy test. To enable it, you can either specify --extend=tidypy.plugin.pbbt on the command line when you run PBBT, or set the extend property in your setup.cfg or pbbt.yaml to tidypy.plugin.pbbt.

A simple interface exists for extending TidyPy to include more and different tools and reporters. To add a tool, create a class that extends tidypy.Tool, and in your setup.py, declare an entry_point for tidypy.tools that points to your class:

entry_points={
    'tidypy.tools': [
        'mycooltool = path.to.model:MyCoolToolClassName',
    ],
}

To add a reporter, the process is nearly identical, except that you extend tidypy.Report and declare an entry_point for tidypy.reports.

Aren't there already tools like this?
Yup. There's prospector, pylama, flake8, and ciocheck just to name a few. But, as is customary in the world of software development, if the wheel isn't as round as you'd like it to be, you must spend countless hours to reinvent it. I've tried a number of these tools (and even contributed to some), but in the end, I always found something lacking or annoying. Thus, TidyPy was born.
How do I run TidyPy on a single file?
The short answer is, you don't (at the moment, anyway). It wasn't designed with that use case in mind. TidyPy was built to analyze a whole project, and show you everything.
I tried TidyPy out on my project and it reported hundreds/thousands of issues. My ego is now bruised.

Yea, that happens. The philosophy I chose to follow with this tool is that I didn't want it to hide anything from me. I wanted its default behavior to execute every tool in its suite using their most obnoxious setting. Then, when I can see the full scope of damage, I can then decide to disable specific tools or issues via a project-level configuration. I figured if someone took the time to implement a check for a particular issue, they must think it has some value. If my tooling hides that from me by default, then I won't be able to gain any benefits from it.

In general, I don't recommend starting to use linters or other sorts of static analyzers when you think you're "done". You should incorporate them into your workflow right at the beginning of a project -- just as you would (or should) your unit tests. That way you find things early and learn from them (or disable them). It's much less daunting a task to deal with when you address them incrementally.

Contributions are most welcome. Particularly if they're bug fixes! To hack on this code, simply clone it, and then run make setup. This will create a virtualenv with all the tools you'll need. The Makefile also has a test target for running the pytest suite, and a lint target for running TidyPy on itself.

TidyPy is released under the terms of the MIT License.

tidypy's People

Contributors

dependabot[bot] avatar douardda avatar jayclassless avatar jwilk avatar scottj97 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

tidypy's Issues

Test on Windows

Set up CI (with AppVeyor, or similar) to test TidyPy on Windows.

Publish v0.8

It would be really nice to have the 0.8 version published and uploaded on pypi, thanks!

David

Unconfigurable report format

I try to use tidypy in Jenkins pipeline, pylint reporting. Jenkins expect format: {path}:{line}: [{msg_id}({symbol}), {obj}] {msg}
tidypy use format '{type}:{line:>3},{character:>2}: {message} ({code}@{tool})'

I think it's pretty simple to add configurable reporting formatter.

Document public API

Need to add documentation (docstrings, readme) for all the classes/functions considered to be the "public" API.

How to scan only one directory?

For example, I have following folders in my repo
app/
website/
docs/
etc.

I want to run tidypy in only app directory as a precommit hook. Please tell me how to achieve this.

Remove Python 2 Support

  • Remove 2to3 tool
  • Simplify dependencies in setup.py
  • Remove usage of six
  • Remove 2.7 from CI setup

rstlint Prints to Console

Occasionally rstlint will dump to stdout/stderr when it finds issues. Need to figure out why and stop it.

Unable to run after clean install

Hi,

This project looks super interesting. Unfortunately, I tried installing and running it, and it seems that tidypy has some conflicting dependencies/sub-dependencies.

Any advice would be greatly appreciated!

aa:~/git/repo [branch]$ rmvirtualenv repo
Removing repo...
aa:~/git/repo [branch]$ mkvirtualenv repo
Using base prefix '/Library/Frameworks/Python.framework/Versions/3.7'
New python executable in /Users/aa/.virtualenvs/repo/bin/python3.7
Also creating executable in /Users/aa/.virtualenvs/repo/bin/python
Installing setuptools, pip, wheel...workon done.
dvirtualenvwrapper.user_scripts creating /Users/aa/.virtualenvs/repo/bin/predeactivate
virtualenvwrapper.user_scripts creating /Users/aa/.virtualenvs/repo/bin/postdeactivate
virtualenvwrapper.user_scripts creating /Users/aa/.virtualenvs/repo/bin/preactivate
virtualenvwrapper.user_scripts creating /Users/aa/.virtualenvs/repo/bin/postactivate
virtualenvwrapper.user_scripts creating /Users/aa/.virtualenvs/repo/bin/get_env_details
ig	aa:~/git/repo [branch]$ workon repo
aa:~/git/repo [branch]$ which python
/Users/aa/.virtualenvs/repo/bin/python
aa:~/git/repo [branch]$ pip list
piPackage    Version
---------- -------
pip        18.1
setuptools 40.4.3
wheel      0.32.2
p aa:~/git/repo [branch]$ pip install tidypy
Collecting tidypy
  Using cached https://files.pythonhosted.org/packages/80/ef/4d74ccf0db57ee619cede7c4672d59551b4d0bf283a4fd7fa7877443a514/tidypy-0.6.0-py2.py3-none-any.whl
Collecting tqdm<5,>=4.11 (from tidypy)
  Using cached https://files.pythonhosted.org/packages/91/55/8cb23a97301b177e9c8e3226dba45bb454411de2cbd25746763267f226c2/tqdm-4.28.1-py2.py3-none-any.whl
Collecting pydiatra<0.13,>=0.12.2 (from tidypy)
Collecting basicserial<0.2,>=0.1 (from tidypy)
  Using cached https://files.pythonhosted.org/packages/80/6f/0da8ffa2fc03f122539cc42581e1736c98fb5021d7e362e7911b77e27494/basicserial-0.1.0-py2.py3-none-any.whl
Collecting pyroma<3,>=2.2 (from tidypy)
  Using cached https://files.pythonhosted.org/packages/63/26/6a894d85cd510ed59c991d4b64d025308e1ee1294251e88aadbdd5659c0b/pyroma-2.4-py2.py3-none-any.whl
Collecting detect-secrets<0.11,>=0.9.1 (from tidypy)
  Using cached https://files.pythonhosted.org/packages/57/03/db1ea045e762b4f7269653549225332eb48c9199876f094d190c3efd8968/detect_secrets-0.10.4-py2.py3-none-any.whl
Collecting pyyaml<5,>=3.12 (from tidypy)
Collecting check-manifest<0.38,>=0.37 (from tidypy)
  Using cached https://files.pythonhosted.org/packages/7a/6a/a723e3a5b2844f47a522013738fea914c9f68d1ef576c97238409bd42e84/check_manifest-0.37-py2.py3-none-any.whl
Collecting pyflakes<1.7,>=1.5 (from tidypy)
  Using cached https://files.pythonhosted.org/packages/d7/40/733bcc64da3161ae4122c11e88269f276358ca29335468005cb0ee538665/pyflakes-1.6.0-py2.py3-none-any.whl
Collecting restructuredtext-lint<2,>=1.1 (from tidypy)
Collecting dennis<1,>=0.9 (from tidypy)
  Using cached https://files.pythonhosted.org/packages/2d/2e/2cb43a5e787387b558d2eeefc2713305d2df97c4622cee37b1e6f5505031/dennis-0.9-py2.py3-none-any.whl
Collecting click<8,>=6 (from tidypy)
  Using cached https://files.pythonhosted.org/packages/fa/37/45185cb5abbc30d7257104c434fe0b07e5a195a6847506c074527aa599ec/Click-7.0-py2.py3-none-any.whl
Collecting vulture<0.30,>=0.25 (from tidypy)
  Using cached https://files.pythonhosted.org/packages/1b/40/92d0b666eaa19bd5aa81a5fc066841f43e7ff140b17eaababb27c5782b4d/vulture-0.29-py2.py3-none-any.whl
Collecting demjson<3,>=2.2.4 (from tidypy)
Collecting six (from tidypy)
  Using cached https://files.pythonhosted.org/packages/67/4b/141a581104b1f6397bfa78ac9d43d8ad29a7ca43ea90a2d863fe3056e86a/six-1.11.0-py2.py3-none-any.whl
Collecting pytoml<0.2,>=0.1 (from tidypy)
Collecting pydocstyle<3,>=2 (from tidypy)
  Using cached https://files.pythonhosted.org/packages/43/8a/f1141af0c8406788a5c38ad5001d4163d903b5384a6517239d2ac42734c8/pydocstyle-2.1.1-py3-none-any.whl
Collecting pycodestyle<2.4,>=2.3 (from tidypy)
  Using cached https://files.pythonhosted.org/packages/e4/81/78fe51eb4038d1388b7217dd63770b0f428370207125047312886c923b26/pycodestyle-2.3.1-py2.py3-none-any.whl
Collecting yamllint<2,>=1.8 (from tidypy)
  Using cached https://files.pythonhosted.org/packages/c5/9c/2d1977d1898caf4133dab2b3a9668e3437d96a3ce09979bc996dfcd231e9/yamllint-1.12.1-py2.py3-none-any.whl
Collecting pep8-naming<0.8,>=0.4 (from tidypy)
  Using cached https://files.pythonhosted.org/packages/39/bb/a34544c789e7e5458ed2db6cbd1c8e227bb01e4ce03a0b15ec4ec93e486d/pep8_naming-0.7.0-py2.py3-none-any.whl
Collecting pylint<2.2,>=2; python_version >= "3.4" (from tidypy)
  Using cached https://files.pythonhosted.org/packages/6e/c2/1e97c238877b6a86562d32297eb33a6670b6220e8ec0ca85f67b66dc893f/pylint-2.1.1-py3-none-any.whl
Collecting requests<3,>=2 (from tidypy)
  Downloading https://files.pythonhosted.org/packages/f1/ca/10332a30cb25b627192b4ea272c351bce3ca1091e541245cccbace6051d8/requests-2.20.0-py2.py3-none-any.whl (60kB)
    100% |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 61kB 1.2MB/s
Collecting bandit<2,>=1.4 (from tidypy)
  Using cached https://files.pythonhosted.org/packages/da/94/34afbe0c28b0c35f5116955c86c20599b3c732ddc1b2c452f190760ebfbf/bandit-1.5.1-py2.py3-none-any.whl
Collecting mccabe<0.7,>=0.6 (from tidypy)
  Using cached https://files.pythonhosted.org/packages/87/89/479dc97e18549e21354893e4ee4ef36db1d237534982482c3681ee6e7b57/mccabe-0.6.1-py2.py3-none-any.whl
Collecting iso8601 (from basicserial<0.2,>=0.1->tidypy)
  Using cached https://files.pythonhosted.org/packages/ef/57/7162609dab394d38bbc7077b7ba0a6f10fb09d8b7701ea56fa1edc0c4345/iso8601-0.1.12-py2.py3-none-any.whl
Requirement already satisfied: setuptools in /Users/aa/.virtualenvs/repo/lib/python3.7/site-packages (from pyroma<3,>=2.2->tidypy) (40.4.3)
Collecting docutils (from pyroma<3,>=2.2->tidypy)
  Using cached https://files.pythonhosted.org/packages/36/fa/08e9e6e0e3cbd1d362c3bbee8d01d0aedb2155c4ac112b19ef3cae8eed8d/docutils-0.14-py3-none-any.whl
Collecting unidiff (from detect-secrets<0.11,>=0.9.1->tidypy)
  Using cached https://files.pythonhosted.org/packages/68/52/c7278fc3c17d1aaade84597968d88f97f0f4ec7288ddedb6970a341c5170/unidiff-0.5.5-py2.py3-none-any.whl
Collecting polib>=1.0.8 (from dennis<1,>=0.9->tidypy)
  Using cached https://files.pythonhosted.org/packages/30/a2/e407c3b00cace3d7fc8df14d364deeecfeb96044e1a317de583bc26eae58/polib-1.1.0-py2.py3-none-any.whl
Collecting snowballstemmer (from pydocstyle<3,>=2->tidypy)
  Using cached https://files.pythonhosted.org/packages/d4/6c/8a935e2c7b54a37714656d753e4187ee0631988184ed50c0cf6476858566/snowballstemmer-1.2.1-py2.py3-none-any.whl
Collecting pathspec>=0.5.3 (from yamllint<2,>=1.8->tidypy)
Collecting flake8-polyfill<2,>=1.0.2 (from pep8-naming<0.8,>=0.4->tidypy)
  Using cached https://files.pythonhosted.org/packages/86/b5/a43fed6fd0193585d17d6faa7b85317d4461f694aaed546098c69f856579/flake8_polyfill-1.0.2-py2.py3-none-any.whl
Collecting astroid>=2.0.0 (from pylint<2.2,>=2; python_version >= "3.4"->tidypy)
  Using cached https://files.pythonhosted.org/packages/19/92/6f6d3591c429dbdb31c18d8476ba1af08d5973d7cc09f66346109e9de7fb/astroid-2.0.4-py3-none-any.whl
Collecting isort>=4.2.5 (from pylint<2.2,>=2; python_version >= "3.4"->tidypy)
  Using cached https://files.pythonhosted.org/packages/1f/2c/22eee714d7199ae0464beda6ad5fedec8fee6a2f7ffd1e8f1840928fe318/isort-4.3.4-py3-none-any.whl
Collecting idna<2.8,>=2.5 (from requests<3,>=2->tidypy)
  Using cached https://files.pythonhosted.org/packages/4b/2a/0276479a4b3caeb8a8c1af2f8e4355746a97fab05a372e4a2c6a6b876165/idna-2.7-py2.py3-none-any.whl
Collecting urllib3<1.25,>=1.21.1 (from requests<3,>=2->tidypy)
  Downloading https://files.pythonhosted.org/packages/8c/4b/5cbc4cb46095f369117dcb751821e1bef9dd86a07c968d8757e9204c324c/urllib3-1.24-py2.py3-none-any.whl (117kB)
    100% |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 122kB 2.1MB/s
Collecting certifi>=2017.4.17 (from requests<3,>=2->tidypy)
  Using cached https://files.pythonhosted.org/packages/56/9d/1d02dd80bc4cd955f98980f28c5ee2200e1209292d5f9e9cc8d030d18655/certifi-2018.10.15-py2.py3-none-any.whl
Collecting chardet<3.1.0,>=3.0.2 (from requests<3,>=2->tidypy)
  Using cached https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl
Collecting GitPython>=1.0.1 (from bandit<2,>=1.4->tidypy)
  Using cached https://files.pythonhosted.org/packages/fe/e5/fafe827507644c32d6dc553a1c435cdf882e0c28918a5bab29f7fbebfb70/GitPython-2.1.11-py2.py3-none-any.whl
Collecting stevedore>=1.20.0 (from bandit<2,>=1.4->tidypy)
  Using cached https://files.pythonhosted.org/packages/35/fa/8683fab2a6e15ecfe107996e56fab91e52fe3ec0b40ca9440a0e1ffe6892/stevedore-1.30.0-py2.py3-none-any.whl
Collecting flake8 (from flake8-polyfill<2,>=1.0.2->pep8-naming<0.8,>=0.4->tidypy)
  Using cached https://files.pythonhosted.org/packages/34/a6/49e2849a0e5464e1b5d621f63bc8453066f0f367bb3b744a33fca0bc1ddd/flake8-3.6.0-py2.py3-none-any.whl
Collecting wrapt (from astroid>=2.0.0->pylint<2.2,>=2; python_version >= "3.4"->tidypy)
Collecting lazy-object-proxy (from astroid>=2.0.0->pylint<2.2,>=2; python_version >= "3.4"->tidypy)
Collecting gitdb2>=2.0.0 (from GitPython>=1.0.1->bandit<2,>=1.4->tidypy)
  Using cached https://files.pythonhosted.org/packages/da/30/a407568aa8d8f25db817cf50121a958722f3fc5f87e3a6fba1f40c0633e3/gitdb2-2.0.5-py2.py3-none-any.whl
Collecting pbr!=2.1.0,>=2.0.0 (from stevedore>=1.20.0->bandit<2,>=1.4->tidypy)
  Using cached https://files.pythonhosted.org/packages/76/0c/304d968fe010ba7c2ecc1d57e28741ddd3a305439dcf1cdb3b6f896a3c00/pbr-5.1.0-py2.py3-none-any.whl
Collecting smmap2>=2.0.0 (from gitdb2>=2.0.0->GitPython>=1.0.1->bandit<2,>=1.4->tidypy)
  Using cached https://files.pythonhosted.org/packages/55/d2/866d45e3a121ee15a1dc013824d58072fd5c7799c9c34d01378eb262ca8f/smmap2-2.0.5-py2.py3-none-any.whl
flake8 3.6.0 has requirement pycodestyle<2.5.0,>=2.4.0, but you'll have pycodestyle 2.3.1 which is incompatible.
flake8 3.6.0 has requirement pyflakes<2.1.0,>=2.0.0, but you'll have pyflakes 1.6.0 which is incompatible.
Installing collected packages: tqdm, pydiatra, iso8601, six, basicserial, docutils, pyroma, unidiff, pyyaml, detect-secrets, check-manifest, pyflakes, restructuredtext-lint, polib, click, dennis, vulture, demjson, pytoml, snowballstemmer, pydocstyle, pycodestyle, pathspec, yamllint, mccabe, flake8, flake8-polyfill, pep8-naming, wrapt, lazy-object-proxy, astroid, isort, pylint, idna, urllib3, certifi, chardet, requests, smmap2, gitdb2, GitPython, pbr, stevedore, bandit, tidypy
tidypySuccessfully installed GitPython-2.1.11 astroid-2.0.4 bandit-1.5.1 basicserial-0.1.0 certifi-2018.10.15 chardet-3.0.4 check-manifest-0.37 click-7.0 demjson-2.2.4 dennis-0.9 detect-secrets-0.10.4 docutils-0.14 flake8-3.6.0 flake8-polyfill-1.0.2 gitdb2-2.0.5 idna-2.7 iso8601-0.1.12 isort-4.3.4 lazy-object-proxy-1.3.1 mccabe-0.6.1 pathspec-0.5.9 pbr-5.1.0 pep8-naming-0.7.0 polib-1.1.0 pycodestyle-2.3.1 pydiatra-0.12.4 pydocstyle-2.1.1 pyflakes-1.6.0 pylint-2.1.1 pyroma-2.4 pytoml-0.1.19 pyyaml-3.13 requests-2.20.0 restructuredtext-lint-1.1.3 six-1.11.0 smmap2-2.0.5 snowballstemmer-1.2.1 stevedore-1.30.0 tidypy-0.6.0 tqdm-4.28.1 unidiff-0.5.5 urllib3-1.24 vulture-0.29 wrapt-1.10.11 yamllint-1.12.1
aa:~/git/repo [branch]$ tidypy
Traceback (most recent call last):
  File "/Users/aa/.virtualenvs/repo/bin/tidypy", line 7, in <module>
    from tidypy.cli import main
  File "/Users/aa/.virtualenvs/repo/lib/python3.7/site-packages/tidypy/cli.py", line 66, in <module>
    for name, cls in iteritems(get_tools())
  File "/Users/aa/.virtualenvs/repo/lib/python3.7/site-packages/tidypy/config.py", line 35, in get_tools
    get_tools._CACHE[entry.name] = entry.load()
  File "/Users/aa/.virtualenvs/repo/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2331, in load
    self.require(*args, **kwargs)
  File "/Users/aa/.virtualenvs/repo/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2354, in require
    items = working_set.resolve(reqs, env, installer, extras=self.extras)
  File "/Users/aa/.virtualenvs/repo/lib/python3.7/site-packages/pkg_resources/__init__.py", line 786, in resolve
    raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (pycodestyle 2.3.1 (/Users/aa/.virtualenvs/repo/lib/python3.7/site-packages), Requirement.parse('pycodestyle<2.5.0,>=2.4.0'), {'flake8'})```

Update pyflakes

Update to support pyflakes v1.6 after flake8 releases their v3.5 on 10/23.

Fix Handling of ctrl-c

If you hit ctrl-C while TidyPy is running, it gets stuck and sends the CPU to 100%. Not good.

Yamllint error when enabling "key-ordering" and disabling "line-length"

Config:

[yamllint]
use = true
filters = ["\\.yaml$", "\\.yml$",]
disabled = [
  "line-length",
  "document-start",
]

[yamllint.options]
key-ordering = "enable"

Error:

    1     yamllint: Unexpected exception:
          Traceback (most recent call last):
            File "/Users/Pablo/workspace/novum-tests/lib/python3.9/site-packages/yamllint/config.py", line 77, in parse
              conf = yaml.safe_load(raw_content)
            File "/Users/Pablo/workspace/novum-tests/lib/python3.9/site-packages/yaml/__init__.py", line 162, in safe_load
              return load(stream, SafeLoader)
            File "/Users/Pablo/workspace/novum-tests/lib/python3.9/site-packages/yaml/__init__.py", line 114, in load
              return loader.get_single_data()
            File "/Users/Pablo/workspace/novum-tests/lib/python3.9/site-packages/yaml/constructor.py", line 41, in get_single_data
              node = self.get_single_node()
            File "/Users/Pablo/workspace/novum-tests/lib/python3.9/site-packages/yaml/composer.py", line 39, in get_single_node
              if not self.check_event(StreamEndEvent):
            File "/Users/Pablo/workspace/novum-tests/lib/python3.9/site-packages/yaml/parser.py", line 98, in check_event
              self.current_event = self.state()
            File "/Users/Pablo/workspace/novum-tests/lib/python3.9/site-packages/yaml/parser.py", line 171, in parse_document_start
              raise ParserError(None, None,
          yaml.parser.ParserError: expected '<document start>', but found '<block mapping start>'
            in "<unicode string>", line 6, column 3:
                line-length: disable
                ^

          During handling of the above exception, another exception occurred:

          Traceback (most recent call last):
            File "/Users/Pablo/workspace/novum-tests/lib/python3.9/site-packages/tidypy/core.py", line 53, in run
              issues = impl.execute(finder)
            File "/Users/Pablo/workspace/novum-tests/lib/python3.9/site-packages/tidypy/tools/yamllint.py", line 73, in execute
              cfg = self.make_config()
            File "/Users/Pablo/workspace/novum-tests/lib/python3.9/site-packages/tidypy/tools/yamllint.py", line 69, in make_config
              return YamlLintConfig(cfg)
            File "/Users/Pablo/workspace/novum-tests/lib/python3.9/site-packages/yamllint/config.py", line 44, in __init__
              self.parse(content)
            File "/Users/Pablo/workspace/novum-tests/lib/python3.9/site-packages/yamllint/config.py", line 79, in parse
              raise YamlLintConfigError('invalid config: %s' % e)
          yamllint.config.YamlLintConfigError: invalid config: expected '<document start>', but found '<block mapping start>'
            in "<unicode string>", line 6, column 3:
                line-length: disable
                ^
          (tidypy:tool)

I also tried this, with the same result:

[yamllint]
use = true
filters = ["\\.yaml$", "\\.yml$",]

[yamllint.options]
key-ordering = "enable"
line-length = "disable"
document-start "disable"

Support eradicate in python3

The eradicate tool is only supported in python 2, based on this method in tools/eradicate.py:

    def can_be_used(cls):
        return not six.PY3

The eradicate tool has supported python3 for a while now, and after some (probably not python2-friendly) hacks to this file I was able to get tidypy to run it.

Please upgrade tidypy to support eradicate in python3.

Merge pylint:missing-docstring and pydocstyle:D100-pydocstyle:D104

Hi,

I think the Pylint error Missing module docstring (pylint:missing-docstring) has to be merge with Missing docstring in public package (pydocstyle:D100) to Missing docstring in public module (pydocstyle:D104).

Maybe pydocstyle erros have to be kept because they a little bit more accurate.

rstlint: Recognize Sphinx Directives

The rstlint tool should automatically recognize/handle Sphinx directives. They're very commonly used, and the base restructuredtext-lint package we're using doesn't recognize them.

Easy VCS Hook Integrations

Should add support to make using TidyPy in git and mercurial hooks easy. Flake8 has a decent approach -- look there for inspiration.

Broader support for "noqa"

Not every tool supports the pseudo-standard of "noqa" to ignore issues on a line. Should implement it within TidyPy itself.

Should include a --disable-noqa option and forward it along to any tool that supports the notion.

Address Py3K Issues

No good reason TidyPy can't or shouldn't work on Python 3. Hasn't really been tested yet. Will probably need to enable/disable tools based on their support for Py3K. Will probably also want to optionally install them via extras_require to only install tools that we know to work.

Shared/Public Configurations

Add support for shared/public configuration usage.

  • Add an "extends" property to the core configuration. Can be a string or list of strings that reference location(s) of other TidyPy configuration that should be inherited from.
  • Allow a variety of locations:
    • Local files (relative & absolute paths)
    • Public Github gists and projects
    • Public Bitbucket snippets and projects
    • Public Gitlab snippets and projects
    • HTTP URLs?
  • Configurations retrieved from remote locations should be cached. Include a command or option to make refreshing/purging cache easy.

pylint Prints to Console

Occasionally pylint dumps a message like the following to stdout/stderr. It still appears to work and find issues, but the output disrupts TidyPy's output.

Problem importing module async.py: Unable to find module for [...]/lib/python2.7/site-packages/pylint/checkers/async.py in [..., ..., ...]

AttributeError: 'TidyPyVulture' object has no attribute 'noqa_lines'

It seems that Vulture 1.5 (released 2020-05-24) has broken TidyPy.

Error messages

    1     vulture: Unexpected exception:
          Traceback (most recent call last):
            File "/home/sjohnson/python-play/venv/lib/python3.8/site-packages/tidypy/core.py", line 53, in run
              issues = impl.execute(finder)
            File "/home/sjohnson/python-play/venv/lib/python3.8/site-packages/tidypy/tools/vulture.py", line 130, in execute
              self.vulture.scavenge(finder)
            File "/home/sjohnson/python-play/venv/lib/python3.8/site-packages/tidypy/tools/vulture.py", line 58, in scavenge
              self.scan(source, filename=filepath)
            File "/home/sjohnson/python-play/venv/lib/python3.8/site-packages/tidypy/tools/vulture.py", line 73, in scan
              self.visit(node)
            File "/home/sjohnson/python-play/venv/lib/python3.8/site-packages/vulture/core.py", line 629, in visit
              return self.generic_visit(node)
            File "/home/sjohnson/python-play/venv/lib/python3.8/site-packages/vulture/core.py", line 663, in generic_visit
              self.visit(item)
            File "/home/sjohnson/python-play/venv/lib/python3.8/site-packages/vulture/core.py", line 628, in visit
              visitor(node)
            File "/home/sjohnson/python-play/venv/lib/python3.8/site-packages/vulture/core.py", line 573, in visit_FunctionDef
              self._define(
            File "/home/sjohnson/python-play/venv/lib/python3.8/site-packages/vulture/core.py", line 497, in _define
              if ignored(first_lineno):
            File "/home/sjohnson/python-play/venv/lib/python3.8/site-packages/vulture/core.py", line 490, in ignored
              or noqa.ignore_line(self.noqa_lines, lineno, ERROR_CODES[typ])
          AttributeError: 'TidyPyVulture' object has no attribute 'noqa_lines'
          (tidypy:tool)

Root cause

This change in Vulture added a new attribute noqa_lines to the Vulture.scan() method, which is unfortunately copy-pasted into TidyPyVulture, which is now out of date.

Full log

$ mkdir src
$ echo 'if True: X = 1' > src/run.py
$ python3 -V
Python 3.8.0
$ python3 -m venv venv
$ ./venv/bin/pip3 install tidypy
Collecting tidypy
  Using cached https://files.pythonhosted.org/packages/c9/4f/78b8287c188a092fd6453f0f6786b7f33103c8a602fd95fe02b41e263806/tidypy-0.14.0-py3-none-any.whl
Collecting pydocstyle<6,>=4 (from tidypy)
  Using cached https://files.pythonhosted.org/packages/cc/fb/0662498401c663606ef35b4ec6a0aca6b4121d6da8c3ac40a4e68f6ac521/pydocstyle-5.0.2-py3-none-any.whl
Collecting basicserial<2.0,>=0.1 (from tidypy)
  Using cached https://files.pythonhosted.org/packages/6e/52/e619e85211cad107dd002f0060ae158c48411c272f99acaef611a6678e86/basicserial-1.1.0-py3-none-any.whl
Collecting click<8,>=6 (from tidypy)
  Using cached https://files.pythonhosted.org/packages/d2/3d/fa76db83bf75c4f8d338c2fd15c8d33fdd7ad23a9b5e57eb6c5de26b430e/click-7.1.2-py2.py3-none-any.whl
Collecting restructuredtext-lint<2,>=1.1 (from tidypy)
  Using cached https://files.pythonhosted.org/packages/36/a6/507be0d9125cd37530e96062b7f838ee1777a0e30855197964603da7b990/restructuredtext_lint-1.3.1.tar.gz
Collecting pylint<2.6,>=2 (from tidypy)
  Using cached https://files.pythonhosted.org/packages/e8/fb/734960c55474c8f74e6ad4c8588fc44073fb9d69e223269d26a3c2435d16/pylint-2.5.3-py3-none-any.whl
Collecting bandit<2,>=1.4 (from tidypy)
  Using cached https://files.pythonhosted.org/packages/5a/50/ff2f2c8f1f0ca1569f678eeb608c0f973b835985410985594fbee96be820/bandit-1.6.2-py2.py3-none-any.whl
Collecting detect-secrets<0.14,>=0.11.3 (from tidypy)
  Using cached https://files.pythonhosted.org/packages/15/95/f6bada839f3446f6e279bcf7675eae6ec456b652617fbaaad70642f6d3e5/detect_secrets-0.13.1-py2.py3-none-any.whl
Collecting check-manifest<0.42,>=0.37 (from tidypy)
  Using cached https://files.pythonhosted.org/packages/54/40/7faf80474b21b3bd3f97465a31c3204379827379c5017f5cc703eee576ec/check_manifest-0.41-py2.py3-none-any.whl
Collecting requests<3,>=2 (from tidypy)
  Using cached https://files.pythonhosted.org/packages/45/1e/0c169c6a5381e241ba7404532c16a21d86ab872c9bed8bdcd4c423954103/requests-2.24.0-py2.py3-none-any.whl
Collecting tqdm<5,>=4.11 (from tidypy)
  Using cached https://files.pythonhosted.org/packages/46/62/7663894f67ac5a41a0d8812d78d9d2a9404124051885af9d77dc526fb399/tqdm-4.47.0-py2.py3-none-any.whl
Collecting pycodestyle<2.7,>=2.4 (from tidypy)
  Using cached https://files.pythonhosted.org/packages/10/5b/88879fb861ab79aef45c7e199cae3ef7af487b5603dcb363517a50602dd7/pycodestyle-2.6.0-py2.py3-none-any.whl
Collecting pyyaml<6,>=3.12 (from tidypy)
  Using cached https://files.pythonhosted.org/packages/64/c2/b80047c7ac2478f9501676c988a5411ed5572f35d1beff9cae07d321512c/PyYAML-5.3.1.tar.gz
Collecting toml<0.11,>=0.10 (from tidypy)
  Using cached https://files.pythonhosted.org/packages/9f/e1/1b40b80f2e1663a6b9f497123c11d7d988c0919abbf3c3f2688e448c5363/toml-0.10.1-py2.py3-none-any.whl
Collecting pep8-naming<0.11,>=0.4 (from tidypy)
  Using cached https://files.pythonhosted.org/packages/5b/69/6018efb8ae18bd5a05f5f447666060a44aa8fe017f439c50fe8c8bd990cf/pep8_naming-0.10.0-py2.py3-none-any.whl
Collecting mccabe<0.7,>=0.6 (from tidypy)
  Using cached https://files.pythonhosted.org/packages/87/89/479dc97e18549e21354893e4ee4ef36db1d237534982482c3681ee6e7b57/mccabe-0.6.1-py2.py3-none-any.whl
Collecting pydiatra<0.13,>=0.12.2 (from tidypy)
  Using cached https://files.pythonhosted.org/packages/43/83/5717f46f837ebc40414f6f0342534c9ddf9c9abd0455ab708cb93b021d76/pydiatra-0.12.5.tar.gz
Collecting eradicate<2,>=1 (from tidypy)
  Using cached https://files.pythonhosted.org/packages/65/ed/5b4506e122114f9439482d2a810ade4aa06cc4e306185931889e58b47f46/eradicate-1.0.tar.gz
Collecting pyflakes<2.3,>=1.5 (from tidypy)
  Using cached https://files.pythonhosted.org/packages/69/5b/fd01b0c696f2f9a6d2c839883b642493b431f28fa32b29abc465ef675473/pyflakes-2.2.0-py2.py3-none-any.whl
Collecting vulture<2,>=1.1 (from tidypy)
  Using cached https://files.pythonhosted.org/packages/b4/6a/df844d624e1e1f8a01873268850ac0976bf930164bfca141c103d39308ce/vulture-1.5-py2.py3-none-any.whl
Collecting pyroma<3,>=2.2 (from tidypy)
  Using cached https://files.pythonhosted.org/packages/74/67/9f162a493011a3235761ea980a5ead7de189fb40c955da7555e7c82e2b20/pyroma-2.6-py2.py3-none-any.whl
Collecting dennis<1,>=0.9 (from tidypy)
  Using cached https://files.pythonhosted.org/packages/2d/2e/2cb43a5e787387b558d2eeefc2713305d2df97c4622cee37b1e6f5505031/dennis-0.9-py2.py3-none-any.whl
Collecting demjson<3,>=2.2.4 (from tidypy)
  Using cached https://files.pythonhosted.org/packages/96/67/6db789e2533158963d4af689f961b644ddd9200615b8ce92d6cad695c65a/demjson-2.2.4.tar.gz
Collecting yamllint<2,>=1.8 (from tidypy)
  Using cached https://files.pythonhosted.org/packages/9e/e5/1895d308f95e44104472205df81dd6e68f326d4887c7502b90436c5bc91e/yamllint-1.23.0-py2.py3-none-any.whl
Collecting dlint<0.11,>=0.8 (from tidypy)
  Using cached https://files.pythonhosted.org/packages/cb/78/9a3fb63fe943d3c8d47d3fdcabcfa8ed2bbe4de80eb95d550bcdb4735342/dlint-0.10.3-py2.py3-none-any.whl
Collecting snowballstemmer (from pydocstyle<6,>=4->tidypy)
  Using cached https://files.pythonhosted.org/packages/7d/4b/cdf1113a0e88b641893b814e9c36f69a6fda28cd88b62c7f0d858cde3166/snowballstemmer-2.0.0-py2.py3-none-any.whl
Collecting iso8601 (from basicserial<2.0,>=0.1->tidypy)
  Using cached https://files.pythonhosted.org/packages/ef/57/7162609dab394d38bbc7077b7ba0a6f10fb09d8b7701ea56fa1edc0c4345/iso8601-0.1.12-py2.py3-none-any.whl
Collecting docutils<1.0,>=0.11 (from restructuredtext-lint<2,>=1.1->tidypy)
  Using cached https://files.pythonhosted.org/packages/81/44/8a15e45ffa96e6cf82956dd8d7af9e666357e16b0d93b253903475ee947f/docutils-0.16-py2.py3-none-any.whl
Collecting astroid<=2.5,>=2.4.0 (from pylint<2.6,>=2->tidypy)
  Using cached https://files.pythonhosted.org/packages/24/a8/5133f51967fb21e46ee50831c3f5dda49e976b7f915408d670b1603d41d6/astroid-2.4.2-py3-none-any.whl
Collecting isort<5,>=4.2.5 (from pylint<2.6,>=2->tidypy)
  Using cached https://files.pythonhosted.org/packages/e5/b0/c121fd1fa3419ea9bfd55c7f9c4fedfec5143208d8c7ad3ce3db6c623c21/isort-4.3.21-py2.py3-none-any.whl
Collecting stevedore>=1.20.0 (from bandit<2,>=1.4->tidypy)
  Using cached https://files.pythonhosted.org/packages/45/62/aa4c77e0f0899b7697445d8126fd099473452488d70f877426812c2ce982/stevedore-2.0.1-py3-none-any.whl
Collecting six>=1.10.0 (from bandit<2,>=1.4->tidypy)
  Using cached https://files.pythonhosted.org/packages/ee/ff/48bde5c0f013094d729fe4b0316ba2a24774b3ff1c52d924a8a4cb04078a/six-1.15.0-py2.py3-none-any.whl
Collecting GitPython>=1.0.1 (from bandit<2,>=1.4->tidypy)
  Using cached https://files.pythonhosted.org/packages/8c/f9/c315aa88e51fabdc08e91b333cfefb255aff04a2ee96d632c32cb19180c9/GitPython-3.1.3-py3-none-any.whl
Collecting pep517 (from check-manifest<0.42,>=0.37->tidypy)
  Using cached https://files.pythonhosted.org/packages/43/f6/4af3567c136e8e1620f6fcff665f9a478e68d06f9c990d0f2717cf9a2b8c/pep517-0.8.2-py2.py3-none-any.whl
Collecting chardet<4,>=3.0.2 (from requests<3,>=2->tidypy)
  Using cached https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl
Collecting idna<3,>=2.5 (from requests<3,>=2->tidypy)
  Using cached https://files.pythonhosted.org/packages/a2/38/928ddce2273eaa564f6f50de919327bf3a00f091b5baba8dfa9460f3a8a8/idna-2.10-py2.py3-none-any.whl
Collecting certifi>=2017.4.17 (from requests<3,>=2->tidypy)
  Using cached https://files.pythonhosted.org/packages/5e/c4/6c4fe722df5343c33226f0b4e0bb042e4dc13483228b4718baf286f86d87/certifi-2020.6.20-py2.py3-none-any.whl
Collecting urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 (from requests<3,>=2->tidypy)
  Using cached https://files.pythonhosted.org/packages/e1/e5/df302e8017440f111c11cc41a6b432838672f5a70aa29227bf58149dc72f/urllib3-1.25.9-py2.py3-none-any.whl
Collecting flake8-polyfill<2,>=1.0.2 (from pep8-naming<0.11,>=0.4->tidypy)
  Using cached https://files.pythonhosted.org/packages/86/b5/a43fed6fd0193585d17d6faa7b85317d4461f694aaed546098c69f856579/flake8_polyfill-1.0.2-py2.py3-none-any.whl
Requirement already satisfied: setuptools in ./venv/lib/python3.8/site-packages (from pyroma<3,>=2.2->tidypy) (41.2.0)
Collecting pygments (from pyroma<3,>=2.2->tidypy)
  Using cached https://files.pythonhosted.org/packages/2d/68/106af3ae51daf807e9cdcba6a90e518954eb8b70341cee52995540a53ead/Pygments-2.6.1-py3-none-any.whl
Collecting polib>=1.0.8 (from dennis<1,>=0.9->tidypy)
  Using cached https://files.pythonhosted.org/packages/30/a2/e407c3b00cace3d7fc8df14d364deeecfeb96044e1a317de583bc26eae58/polib-1.1.0-py2.py3-none-any.whl
Collecting pathspec>=0.5.3 (from yamllint<2,>=1.8->tidypy)
  Using cached https://files.pythonhosted.org/packages/5d/d0/887c58853bd4b6ffc7aa9cdba4fc57d7b979b45888a6bd47e4568e1cf868/pathspec-0.8.0-py2.py3-none-any.whl
Collecting flake8<4.0.0,>=3.6.0 (from dlint<0.11,>=0.8->tidypy)
  Using cached https://files.pythonhosted.org/packages/6c/20/6326a9a0c6f0527612bae748c4c03df5cd69cf06dfb2cf59d85c6e165a6a/flake8-3.8.3-py2.py3-none-any.whl
Collecting wrapt~=1.11 (from astroid<=2.5,>=2.4.0->pylint<2.6,>=2->tidypy)
Collecting lazy-object-proxy==1.4.* (from astroid<=2.5,>=2.4.0->pylint<2.6,>=2->tidypy)
  Using cached https://files.pythonhosted.org/packages/34/8c/74acd0ad5a0518be9e0f3b4d022e84da0c1d9b78972afce73259ac85d78b/lazy_object_proxy-1.4.3-cp38-cp38-manylinux1_x86
_64.whl
Collecting pbr!=2.1.0,>=2.0.0 (from stevedore>=1.20.0->bandit<2,>=1.4->tidypy)
  Using cached https://files.pythonhosted.org/packages/96/ba/aa953a11ec014b23df057ecdbc922fdb40ca8463466b1193f3367d2711a6/pbr-5.4.5-py2.py3-none-any.whl
Collecting gitdb<5,>=4.0.1 (from GitPython>=1.0.1->bandit<2,>=1.4->tidypy)
  Using cached https://files.pythonhosted.org/packages/48/11/d1800bca0a3bae820b84b7d813ad1eff15a48a64caea9c823fc8c1b119e8/gitdb-4.0.5-py3-none-any.whl
Collecting smmap<4,>=3.0.1 (from gitdb<5,>=4.0.1->GitPython>=1.0.1->bandit<2,>=1.4->tidypy)
  Using cached https://files.pythonhosted.org/packages/b0/9a/4d409a6234eb940e6a78dfdfc66156e7522262f5f2fecca07dc55915952d/smmap-3.0.4-py2.py3-none-any.whl
Installing collected packages: snowballstemmer, pydocstyle, iso8601, basicserial, click, docutils, restructuredtext-lint, mccabe, six, wrapt, lazy-object-proxy, astroid, 
isort, toml, pylint, pbr, stevedore, pyyaml, smmap, gitdb, GitPython, bandit, chardet, idna, certifi, urllib3, requests, detect-secrets, pep517, check-manifest, tqdm, pyc
odestyle, pyflakes, flake8, flake8-polyfill, pep8-naming, pydiatra, eradicate, vulture, pygments, pyroma, polib, dennis, demjson, pathspec, yamllint, dlint, tidypy
  Running setup.py install for restructuredtext-lint: started
    Running setup.py install for restructuredtext-lint: finished with status 'done'
  Running setup.py install for pyyaml: started
    Running setup.py install for pyyaml: finished with status 'done'
  Running setup.py install for pydiatra: started
    Running setup.py install for pydiatra: finished with status 'done'
  Running setup.py install for eradicate: started
    Running setup.py install for eradicate: finished with status 'done'
  Running setup.py install for demjson: started
    Running setup.py install for demjson: finished with status 'done'
Successfully installed GitPython-3.1.3 astroid-2.4.2 bandit-1.6.2 basicserial-1.1.0 certifi-2020.6.20 chardet-3.0.4 check-manifest-0.41 click-7.1.2 demjson-2.2.4 dennis-0
.9 detect-secrets-0.13.1 dlint-0.10.3 docutils-0.16 eradicate-1.0 flake8-3.8.3 flake8-polyfill-1.0.2 gitdb-4.0.5 idna-2.10 iso8601-0.1.12 isort-4.3.21 lazy-object-proxy-1
.4.3 mccabe-0.6.1 pathspec-0.8.0 pbr-5.4.5 pep517-0.8.2 pep8-naming-0.10.0 polib-1.1.0 pycodestyle-2.6.0 pydiatra-0.12.5 pydocstyle-5.0.2 pyflakes-2.2.0 pygments-2.6.1 py
lint-2.5.3 pyroma-2.6 pyyaml-5.3.1 requests-2.24.0 restructuredtext-lint-1.3.1 six-1.15.0 smmap-3.0.4 snowballstemmer-2.0.0 stevedore-2.0.1 tidypy-0.14.0 toml-0.10.1 tqdm
-4.47.0 urllib3-1.25.9 vulture-1.5 wrapt-1.12.1 yamllint-1.23.0
WARNING: You are using pip version 19.2.3, however version 20.1.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
$ (cd src && ../venv/bin/tidypy check)
Analyzing |โ–ˆโ–ˆโ–‰       |  29% [00:00, current=bandit,eradicate,polint,pycodestyle]
Analyzing |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ   |  71% [00:00, current=pycodestyle,pylint,sec,pylint,secrets]  
Analyzing |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 100% [00:00]                                             
Analyzing |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 100% [00:00]. (1)
    1     vulture: Unexpected exception:
          Traceback (most recent call last):
            File "/home/sjohnson/python-play/venv/lib/python3.8/site-packages/tidypy/core.py", line 53, in run
              issues = impl.execute(finder)
            File "/home/sjohnson/python-play/venv/lib/python3.8/site-packages/tidypy/tools/vulture.py", line 130, in execute
              self.vulture.scavenge(finder)
            File "/home/sjohnson/python-play/venv/lib/python3.8/site-packages/tidypy/tools/vulture.py", line 58, in scavenge
              self.scan(source, filename=filepath)
            File "/home/sjohnson/python-play/venv/lib/python3.8/site-packages/tidypy/tools/vulture.py", line 73, in scan
              self.visit(node)
            File "/home/sjohnson/python-play/venv/lib/python3.8/site-packages/vulture/core.py", line 629, in visit
              return self.generic_visit(node)
            File "/home/sjohnson/python-play/venv/lib/python3.8/site-packages/vulture/core.py", line 663, in generic_visit
              self.visit(item)
            File "/home/sjohnson/python-play/venv/lib/python3.8/site-packages/vulture/core.py", line 628, in visit
              visitor(node)
            File "/home/sjohnson/python-play/venv/lib/python3.8/site-packages/vulture/core.py", line 585, in visit_If
              self._handle_conditional_node(node, "if")
            File "/home/sjohnson/python-play/venv/lib/python3.8/site-packages/vulture/core.py", line 435, in _handle_conditional_node
              self._define(
            File "/home/sjohnson/python-play/venv/lib/python3.8/site-packages/vulture/core.py", line 497, in _define
              if ignored(first_lineno):
            File "/home/sjohnson/python-play/venv/lib/python3.8/site-packages/vulture/core.py", line 490, in ignored
              or noqa.ignore_line(self.noqa_lines, lineno, ERROR_CODES[typ])
          AttributeError: 'TidyPyVulture' object has no attribute 'noqa_lines'
          (tidypy:tool)

run.py (5)
    1     Missing docstring in public module (pydocstyle:D100)
    1     Missing module docstring (pylint:missing-module-docstring)
    1     Using a conditional statement with a constant value (pylint:using-constant-test)
    1:8   multiple statements on one line (colon) (pycodestyle:E701)
    1:10  More than one statement on a single line (pylint:multiple-statements)

โœ— 6 issues found.

# noqa: at file scope

pylint has an option to disable specific checks for an entire file py if there's a # pylint: disable at the top of a file.

It would be handy to extend tidypy's noqa syntax to work this way too.

I'll have a go at setting this up unless there's an objection.

Configuration is undocumented

The Configuration section of the README currently says "TODO", and the command tidypy default-config doesn't even tell me what filename to use for the config it prints to stdout.

How do I make a config file for tidypy? At least document the filename it's looking for.

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.