{ "info": { "author": "grdvnl", "author_email": "grdvnl@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Programming Language :: Python" ], "description": "[![Build Status](https://travis-ci.org/InvestmentSystems/pydelinter.svg?branch=master)](https://travis-ci.org/InvestmentSystems/pydelinter)\n![PyPI version](https://badge.fury.io/py/pydelinter.svg)\n\n# pydelinter\n\nPydelinter automatically generates unified-diffs of python source code that violate certain class of Pylint warnings. You can run this tool on your source code, inspect the diffs and apply the diffs as patches.\n\n## Installation\n\npip install pydelinter\n\n\n## Usage\n\n``` shell\n\n$ delint -h\nusage: delint [-h] [--msg_id MSG_ID] [--version] [-v] [-vv]\n file_path_or_folder\n\nCommand line tool for delinting certain pylint messages\n\npositional arguments:\n file_path_or_folder Path to a .py file or folder contain *.py files. This\n relative path will be used to generate the unified diff\n files.\n\noptional arguments:\n -h, --help show this help message and exit\n --msg_id MSG_ID The pylint message that will be delinterd. Eg W0611\n --version show program's version number and exit\n -v, --verbose set loglevel to INFO\n -vv, --very-verbose set loglevel to DEBUG\n\nExamples:\n\n Running the below examples will generate an unified-diff file that can be used as a patch to apply the changes to git or Mercurial.\n delinter/main.py --msg W0611 foo/core.py\n\n To process multiple python files, provide a folder\n delinter/main.py --msg W0611 foo/\n\n Running, this command on the test file available with this repository:\n delinter/main.py --msg W0611 delinter/test/input\n\n --- a/delinter/test/input/test_unused_imports.py\n +++ b/delinter/test/input/test_unused_imports.py\n @@ -1,12 +1,7 @@\n -import unitest.mock.patch, unittest.mock.patch as p1\n import unitest.mock.patch, unittest.mock.patch as p2\n -import unittest as t, unittest as t2\n +import unittest as t2\n import unitest.mock.patch as p\n -import os\n -import pandas as pd, numpy as np\n -from collections.abc import defaultdict, OrderedDict\n -from itertools import filterfalse as _filterfalse\n -from collections.abc import x, y\n +from collections.abc import y\n from collections import *\n\n p2.mock() # use p2\n\n\n```\n\n\n## Status of pylint messages supported\n\n\n| Message Id | Message | Status |\n|------------|:--------:|:-------:|\n| W0611 | unused-imports | :heavy_check_mark: |\n| W0404 | reimported |:heavy_check_mark: |\n|W0108|unnecessary-lambda||\n|W0107|unnecessary-pass||\n|E1111|assignment-from-no-return||\n|E0701|bad-except-order||\n|E0711|not-implemented-raised||\n|C0411|wrong-import-order||\n|C0412|ungrouped-imports||\n|C0410|multiple-imports||\n|W0611|unused-variable||\n|W0613|unused-argument||\n|W0612|unused-wildcard-import||\n|W0602|global-variable-not-assigned||\n|R0102|simplifiable-if-statement||\n|C0326|bad-whitespace||\n|C0304|missing-final-newline||\n|C0327|multiple-statements||\n|C0305|trailing-newline||\n|C0303|trailing-whitespace||\n|C0325|superfluous-parens||\n\n(more items will be added to this list after carefully reviewing all message groups supported by Pylint)\n\n## Objectives of this tool\n\n1. The tool will only support addressing one pytlint warning/error at a time. This is provided through the `msg_id` argument.\n2. Any warnings that might need complex formatting will not be supported. We leave that to more sophisticated tools like ```Black```.\n\n## Caveats\n\n1. When dropping statements, preceeding newlines/comments attached to the statement will be removed.\n2. Given how pylint reports warnings, the tool might have to be run on the same code base more than once, after applying the previous patch. For example, an (reimported) error on a particular statement, precededs an (unused-import) error. Therefore, re-running the program will force this statement to be tagged by pylint as an unused-import.\n3. The diffs produces by this tool is only as good as how pylint reports warning/errors and howthe LibCST yields the CST. Therefore, manual review of the patches is always a good idea (along with a good test suite).\n\n## Acknowledgements\n\nThis project has been set up using PyScaffold 3.2.3. For details and usage\ninformation on PyScaffold see https://pyscaffold.org/.\n\n\nThis library primarily depends upon the LibCST [https://github.com/Instagram/LibCST] library.\n\n\n", "description_content_type": "text/markdown; charset=UTF-8", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/gdevanla/pydelinter", "keywords": "", "license": "mit", "maintainer": "", "maintainer_email": "", "name": "pydelinter", "package_url": "https://pypi.org/project/pydelinter/", "platform": "any", "project_url": "https://pypi.org/project/pydelinter/", "project_urls": { "Documentation": "https://github.com/gdevanla/pydelinter", "Homepage": "https://github.com/gdevanla/pydelinter" }, "release_url": "https://pypi.org/project/pydelinter/0.0.3/", "requires_dist": [ "libcst (==0.3.14)", "pylint (==2.4.3)", "pytest ; extra == 'testing'", "pytest-cov ; extra == 'testing'" ], "requires_python": "", "summary": "Automatically fix pytlint warnings/errors.", "version": "0.0.3", "yanked": false, "yanked_reason": null }, "last_serial": 8740343, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "85f68943706a03a2c1466db17ad5d1ad", "sha256": "cb1bf9ec56f3bbf67b8efb8926749c9b655d6904743e3663bebc42732cc7e5c1" }, "downloads": -1, "filename": "pydelinter-0.0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "85f68943706a03a2c1466db17ad5d1ad", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 9171, "upload_time": "2019-10-23T03:20:39", "upload_time_iso_8601": "2019-10-23T03:20:39.677753Z", "url": "https://files.pythonhosted.org/packages/14/b2/5d6ad283c47f189bc3c4994ef3302ff53ee3385074504af249b882f4618c/pydelinter-0.0.1-py2.py3-none-any.whl", "yanked": false, "yanked_reason": null } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "3c275a1c60ac5487af12886aee59e9ce", "sha256": "cb13d1b90b901b5acb39b099daca2656ef4d09177f77e3a90bb186e5ca2253af" }, "downloads": -1, "filename": "pydelinter-0.0.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "3c275a1c60ac5487af12886aee59e9ce", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 9209, "upload_time": "2019-10-23T03:35:36", "upload_time_iso_8601": "2019-10-23T03:35:36.781066Z", "url": "https://files.pythonhosted.org/packages/8c/f0/977f0dccf13ab3cf2325aab290a685587cafd80859257804070ce0559dac/pydelinter-0.0.2-py2.py3-none-any.whl", "yanked": false, "yanked_reason": null } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "e20f99375158fba8c639a8b776a1af5d", "sha256": "c7b5f5517e976a79b8060a8ee61c7e5df4f5bffedac4fae1b31a9db52fc4e950" }, "downloads": -1, "filename": "pydelinter-0.0.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "e20f99375158fba8c639a8b776a1af5d", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 11920, "upload_time": "2020-11-24T20:40:32", "upload_time_iso_8601": "2020-11-24T20:40:32.451335Z", "url": "https://files.pythonhosted.org/packages/b2/b8/5c6210c33580eb2ff61d3854faf9ec2a1df4f573f7f892c4cd7fc5671421/pydelinter-0.0.3-py2.py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "cb28df3bac8255bd08e5c81026fe8df1", "sha256": "893077edb42585d3ddbcc5c1061c7790aef8b752f2b41139d14da99bf600078d" }, "downloads": -1, "filename": "pydelinter-0.0.3.tar.gz", "has_sig": false, "md5_digest": "cb28df3bac8255bd08e5c81026fe8df1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22939, "upload_time": "2020-11-24T20:40:33", "upload_time_iso_8601": "2020-11-24T20:40:33.351919Z", "url": "https://files.pythonhosted.org/packages/11/71/e9810e5cbaaa2e6fd9bfc3c18f923f6f3986d1f2cf6d1979e7aa5719099d/pydelinter-0.0.3.tar.gz", "yanked": false, "yanked_reason": null } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "e20f99375158fba8c639a8b776a1af5d", "sha256": "c7b5f5517e976a79b8060a8ee61c7e5df4f5bffedac4fae1b31a9db52fc4e950" }, "downloads": -1, "filename": "pydelinter-0.0.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "e20f99375158fba8c639a8b776a1af5d", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 11920, "upload_time": "2020-11-24T20:40:32", "upload_time_iso_8601": "2020-11-24T20:40:32.451335Z", "url": "https://files.pythonhosted.org/packages/b2/b8/5c6210c33580eb2ff61d3854faf9ec2a1df4f573f7f892c4cd7fc5671421/pydelinter-0.0.3-py2.py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "cb28df3bac8255bd08e5c81026fe8df1", "sha256": "893077edb42585d3ddbcc5c1061c7790aef8b752f2b41139d14da99bf600078d" }, "downloads": -1, "filename": "pydelinter-0.0.3.tar.gz", "has_sig": false, "md5_digest": "cb28df3bac8255bd08e5c81026fe8df1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22939, "upload_time": "2020-11-24T20:40:33", "upload_time_iso_8601": "2020-11-24T20:40:33.351919Z", "url": "https://files.pythonhosted.org/packages/11/71/e9810e5cbaaa2e6fd9bfc3c18f923f6f3986d1f2cf6d1979e7aa5719099d/pydelinter-0.0.3.tar.gz", "yanked": false, "yanked_reason": null } ], "vulnerabilities": [] }