{ "info": { "author": "", "author_email": "", "bugtrack_url": null, "classifiers": [ "Environment :: Console", "License :: OSI Approved :: BSD License", "Operating System :: MacOS :: MacOS X", "Operating System :: Microsoft :: Windows", "Operating System :: POSIX", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Topic :: Security", "Topic :: Software Development :: Quality Assurance" ], "description": "# Dlint\n\n[![CI](https://github.com/dlint-py/dlint/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/dlint-py/dlint/actions/workflows/ci.yml)\n[![Coverage Status](https://coveralls.io/repos/github/dlint-py/dlint/badge.svg?branch=master)](https://coveralls.io/github/dlint-py/dlint?branch=master)\n[![Python Versions](https://img.shields.io/pypi/pyversions/dlint.svg)](https://pypi.org/project/dlint/)\n[![PyPI Version](https://img.shields.io/pypi/v/dlint.svg)](https://pypi.org/project/dlint/)\n\nDlint is a tool for encouraging best coding practices and helping ensure Python code is secure.\n\n> The most important thing I have done as a programmer in recent years is to\n> aggressively pursue static code analysis. Even more valuable than the\n> hundreds of serious bugs I have prevented with it is the change in mindset\n> about the way I view software reliability and code quality.\n> - [John Carmack, 2011](https://www.gamasutra.com/view/news/128836/InDepth_Static_Code_Analysis.php)\n\n> For a static analysis project to succeed, developers must feel they benefit\n> from and enjoy using it.\n> - [Lessons from Building Static Analysis Tools at Google](https://cacm.acm.org/magazines/2018/4/226371-lessons-from-building-static-analysis-tools-at-google/fulltext)\n\nFor documentation and a list of rules see [docs](https://github.com/dlint-py/dlint/tree/master/docs).\n\n# Installing\n\n```\n$ python -m pip install dlint\n```\n\nAnd double check that it was installed correctly:\n\n```\n$ python -m flake8 -h\nUsage: flake8 [options] file file ...\n\n...\n\nInstalled plugins: dlint: 0.12.0, mccabe: 0.5.3, pycodestyle: 2.2.0, pyflakes: 1.3.0\n```\n\nNote the `dlint: 0.12.0`.\n\n# Using\n\nDlint builds on `flake8` to perform its linting. This provides many\nuseful features without re-inventing the wheel.\n\n## CLI\n\nLet's run a simple check:\n\n```\n$ cat << EOF > test.py\nprint(\"TEST1\")\nexec('print(\"TEST2\")')\nEOF\n```\n\n```\n$ python test.py\nTEST1\nTEST2\n```\n\n```\n$ python -m flake8 --select=DUO test.py\ntest.py:2:1: DUO105 use of \"exec\" is insecure\n```\n\n* *Why is this insecure? To learn more visit [`/docs/linters/DUO105.md`](https://github.com/dlint-py/dlint/blob/master/docs/linters/DUO105.md).*\n* *Why `DUO`? Dlint was originally developed by the [Duo Labs](https://duo.com/blog/introducing-dlint-robust-static-analysis-for-python) team.*\n\nThe `--select=DUO` flag tells `flake8` to only run Dlint lint rules.\n\nFrom here, we can easily run Dlint against a directory of Python code:\n\n```\n$ python -m flake8 --select=DUO /path/to/code\n```\n\nTo fine-tune your linting, check out the `flake8` help:\n\n```\n$ python -m flake8 --help\n```\n\n## Inline Editor\n\nDlint results can also be included inline in your editor for fast feedback.\nThis typically requires an editor plugin or extension. Here are some starting\npoints for common editors:\n\n* Vim: [https://github.com/vim-syntastic/syntastic](https://github.com/vim-syntastic/syntastic)\n* Emacs: [https://github.com/flycheck/flycheck](https://github.com/flycheck/flycheck)\n* Sublime: [https://github.com/SublimeLinter/SublimeLinter-flake8](https://github.com/SublimeLinter/SublimeLinter-flake8)\n* PyCharm: [https://foxmask.net/post/2016/02/17/pycharm-running-flake8/](https://foxmask.net/post/2016/02/17/pycharm-running-flake8/)\n* Atom: [https://atom.io/packages/linter-flake8](https://atom.io/packages/linter-flake8)\n* Visual Studio Code: [https://code.visualstudio.com/docs/python/linting#_flake8](https://code.visualstudio.com/docs/python/linting#_flake8)\n\n# Integrating\n\nDlint can easily be integrated into CI pipelines, or anything really.\n\nFor more information and examples see ['How can I integrate Dlint into XYZ?'](https://github.com/dlint-py/dlint/tree/master/docs#how-can-i-integrate-dlint-into-xyz).\n\n# Custom Plugins\n\nDlint's custom plugins are built on a [simple naming convention](https://packaging.python.org/guides/creating-and-discovering-plugins/#using-naming-convention),\nand rely on [Python modules](https://docs.python.org/3/distutils/examples.html#pure-python-distribution-by-module).\nTo make a Dlint custom plugin use the following conventions:\n\n* The Python module name **must** start with `dlint_plugin_`.\n* The linter class name **must** start with `Dlint`.\n* The linter class **should** inherit from `dlint.linters.base.BaseLinter`.\n * If for some reason you'd like to avoid this, then you **must** implement\n\tthe `get_results` function appropriately and inherit from `ast.NodeVisitor`.\n\nSee an [example plugin](https://github.com/dlint-py/dlint-plugin-example) for further details.\n\n# Developing\n\nFirst, install development packages:\n\n```\n$ python -m pip install -r requirements.txt\n$ python -m pip install -r requirements-dev.txt\n$ python -m pip install -e .\n```\n\n## Testing\n\n```\n$ pytest\n```\n\n## Linting\n\n```\n$ flake8\n```\n\n## Coverage\n\n```\n$ pytest --cov\n```\n\n## Benchmarking\n\n```\n$ pytest -k test_benchmark_run --benchmark-py-file /path/to/file.py tests/test_benchmark/\n```\n\nOr get benchmark results for linters individually:\n\n```\n$ pytest -k test_benchmark_individual --benchmark-py-file /path/to/file.py tests/test_benchmark/\n```\n\nOr run against a single linter:\n\n```\n$ pytest -k test_benchmark_individual[DUO138-BadReCatastrophicUseLinter] --benchmark-py-file /path/to/file.py tests/test_benchmark/\n```\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/dlint-py/dlint", "keywords": "", "license": "BSD-3-Clause", "maintainer": "", "maintainer_email": "", "name": "dlint", "package_url": "https://pypi.org/project/dlint/", "platform": "", "project_url": "https://pypi.org/project/dlint/", "project_urls": { "Homepage": "https://github.com/dlint-py/dlint" }, "release_url": "https://pypi.org/project/dlint/0.12.0/", "requires_dist": [ "flake8 (<5.0.0,>=3.6.0)" ], "requires_python": "", "summary": "Dlint is a tool for encouraging best coding practices and helping ensure Python code is secure.", "version": "0.12.0", "yanked": false, "yanked_reason": null }, "last_serial": 11846505, "releases": { "0.10.0": [ { "comment_text": "", "digests": { "md5": "976e5b76bc6ca791b2116cae332a9f69", "sha256": "775d4d88163f3299bb84e029d221b46a0f1a1ac1a8557b2f6905b812759f9aa5" }, "downloads": -1, "filename": "dlint-0.10.0-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "976e5b76bc6ca791b2116cae332a9f69", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 81919, "upload_time": "2020-01-21T14:50:03", "upload_time_iso_8601": "2020-01-21T14:50:03.606550Z", "url": "https://files.pythonhosted.org/packages/43/b3/353755d7c3190a3317e5ec018a3afa6b7702b74500deea4c0bccf3aaf4b4/dlint-0.10.0-py2.py3-none-any.whl", "yanked": false, "yanked_reason": null } ], "0.10.1": [ { "comment_text": "", "digests": { "md5": "cce2bb904de852fc5244f2cc2fbdf318", "sha256": "a4cef4480d0fba382da97cb162704d5c45cd6e6002c0907cb544d632edb732f7" }, "downloads": -1, "filename": "dlint-0.10.1-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "cce2bb904de852fc5244f2cc2fbdf318", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 81991, "upload_time": "2020-01-21T16:08:30", "upload_time_iso_8601": "2020-01-21T16:08:30.053587Z", "url": "https://files.pythonhosted.org/packages/91/3b/5bc6f00d4701eafcfd59c55faafd87de4b725d288fd48cc58237a4e51a33/dlint-0.10.1-py2.py3-none-any.whl", "yanked": false, "yanked_reason": null } ], "0.10.2": [ { "comment_text": "", "digests": { "md5": "7dcc4d78c63ab750893c418e623d6f41", "sha256": "e640c2425aecd864331fb40e2ad2c0507b7a6d7c96be681973f36c3caac7fb34" }, "downloads": -1, "filename": "dlint-0.10.2-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "7dcc4d78c63ab750893c418e623d6f41", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 83414, "upload_time": "2020-02-19T17:26:36", "upload_time_iso_8601": "2020-02-19T17:26:36.213013Z", "url": "https://files.pythonhosted.org/packages/df/4c/f83b20f8b6a8a51f3e47d83e761467be17235856bf98617c19b2b5bfacb2/dlint-0.10.2-py2.py3-none-any.whl", "yanked": false, "yanked_reason": null } ], "0.10.3": [ { "comment_text": "", "digests": { "md5": "dfba7eebcc07166dc2b5d0d1655014e9", "sha256": "62a187c71cd666bf5b0dbfa9543af62238a498c6d7f7188f6ad7b7d01c3ad49c" }, "downloads": -1, "filename": "dlint-0.10.3-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "dfba7eebcc07166dc2b5d0d1655014e9", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 83985, "upload_time": "2020-03-09T15:14:43", "upload_time_iso_8601": "2020-03-09T15:14:43.788823Z", "url": "https://files.pythonhosted.org/packages/cb/78/9a3fb63fe943d3c8d47d3fdcabcfa8ed2bbe4de80eb95d550bcdb4735342/dlint-0.10.3-py2.py3-none-any.whl", "yanked": false, "yanked_reason": null } ], "0.11.0": [ { "comment_text": "", "digests": { "md5": "e242e068a48e27c1e0b3e1292e71813e", "sha256": "e7297325f57e6b5318d88fba2497f9fea6830458cd5aecb36150856db010f409" }, "downloads": -1, "filename": "dlint-0.11.0-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "e242e068a48e27c1e0b3e1292e71813e", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 84202, "upload_time": "2020-10-30T20:40:39", "upload_time_iso_8601": "2020-10-30T20:40:39.469844Z", "url": "https://files.pythonhosted.org/packages/b7/37/b94ca1444d1e7496431d19d1ad6f0b818ba25ffa4dfc95e292d010330fa1/dlint-0.11.0-py2.py3-none-any.whl", "yanked": false, "yanked_reason": null } ], "0.12.0": [ { "comment_text": "", "digests": { "md5": "3cdd68ebb4150147c95e320b87687db5", "sha256": "344823d299439aa94fe276b2b3b90733026787d25713c664e137cf5f7d0645f7" }, "downloads": -1, "filename": "dlint-0.12.0-py3-none-any.whl", "has_sig": true, "md5_digest": "3cdd68ebb4150147c95e320b87687db5", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 84118, "upload_time": "2021-10-27T13:15:42", "upload_time_iso_8601": "2021-10-27T13:15:42.845122Z", "url": "https://files.pythonhosted.org/packages/45/dd/60b5213a5389cc0fb82b85b1fe71cd5649c6c97d63bfd091b0df752d183e/dlint-0.12.0-py3-none-any.whl", "yanked": false, "yanked_reason": null } ], "0.5.0": [ { "comment_text": "", "digests": { "md5": "aedd902609701a5340e663b8545cfcd4", "sha256": "157ff622a369fc7b4887f9b9daeb43d84da98f24539329c2a112078908d7492d" }, "downloads": -1, "filename": "dlint-0.5.0-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "aedd902609701a5340e663b8545cfcd4", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 61962, "upload_time": "2019-07-17T11:40:43", "upload_time_iso_8601": "2019-07-17T11:40:43.218779Z", "url": "https://files.pythonhosted.org/packages/72/84/239dd751c443713bcd4f2364825d447c6785d4cebb77a5397687b1785f9d/dlint-0.5.0-py2.py3-none-any.whl", "yanked": false, "yanked_reason": null } ], "0.6.0": [ { "comment_text": "", "digests": { "md5": "db01a1a4d6f9b4d1b81d39b9dc1e6810", "sha256": "36f87f60c293cf7033748d8f6cbf48de15a4a6a5d6a1c98a62139cb468baf12a" }, "downloads": -1, "filename": "dlint-0.6.0-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "db01a1a4d6f9b4d1b81d39b9dc1e6810", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 63719, "upload_time": "2019-08-12T13:59:42", "upload_time_iso_8601": "2019-08-12T13:59:42.349621Z", "url": "https://files.pythonhosted.org/packages/5e/f3/d91d77514c8e203d32eac25929cbfe9da049dd49123189410ba156ded1dc/dlint-0.6.0-py2.py3-none-any.whl", "yanked": false, "yanked_reason": null } ], "0.7.0": [ { "comment_text": "", "digests": { "md5": "c04816a3b987a83b446508a07e823f7d", "sha256": "1a7dc637d7703b0d424a826e5baea408d80aa6f076ea21126513e9c60faf4f1e" }, "downloads": -1, "filename": "dlint-0.7.0-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "c04816a3b987a83b446508a07e823f7d", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 66784, "upload_time": "2019-08-24T21:29:13", "upload_time_iso_8601": "2019-08-24T21:29:13.349240Z", "url": "https://files.pythonhosted.org/packages/7a/c4/9ddbc60c22c5edffa82352f7b80f7d260f5957f6715b09abd3d36bdd93d9/dlint-0.7.0-py2.py3-none-any.whl", "yanked": false, "yanked_reason": null } ], "0.8.0": [ { "comment_text": "", "digests": { "md5": "1c5d512c23a720bfaf36ca006fb8d29b", "sha256": "4ee2e04e366039173c605ba8223061ca84b26ea9ca9a62c5419501bdb47ac628" }, "downloads": -1, "filename": "dlint-0.8.0-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "1c5d512c23a720bfaf36ca006fb8d29b", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 71944, "upload_time": "2019-09-18T21:19:05", "upload_time_iso_8601": "2019-09-18T21:19:05.886040Z", "url": "https://files.pythonhosted.org/packages/51/ec/36763e704925b44bbde0a373d42831dff2a342de060fb7ab5c83e6dabfb6/dlint-0.8.0-py2.py3-none-any.whl", "yanked": false, "yanked_reason": null } ], "0.9.0": [ { "comment_text": "", "digests": { "md5": "5e793fe6d139270a44493dd4ee250c1f", "sha256": "96684003591913f33f520e32673135de216973ff133b3f4da6f0e1de7df7648e" }, "downloads": -1, "filename": "dlint-0.9.0-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "5e793fe6d139270a44493dd4ee250c1f", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 73409, "upload_time": "2019-10-23T22:28:20", "upload_time_iso_8601": "2019-10-23T22:28:20.187947Z", "url": "https://files.pythonhosted.org/packages/23/9f/c40b6eb424803c5d72a4f279798c51c5e1f1685faca5417f4d638725b4d5/dlint-0.9.0-py2.py3-none-any.whl", "yanked": false, "yanked_reason": null } ], "0.9.1": [ { "comment_text": "", "digests": { "md5": "676061cd4a2f9ce7891e43cff0713734", "sha256": "a522e7d9a0fd542bce242e68d556d424a13d937938fd14a5e1ad518546162568" }, "downloads": -1, "filename": "dlint-0.9.1-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "676061cd4a2f9ce7891e43cff0713734", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 73890, "upload_time": "2019-11-06T20:09:55", "upload_time_iso_8601": "2019-11-06T20:09:55.131162Z", "url": "https://files.pythonhosted.org/packages/f5/e5/2641041b68397ce88df925085d2fb33b367379684a6974f8a2239d9aafca/dlint-0.9.1-py2.py3-none-any.whl", "yanked": false, "yanked_reason": null } ], "0.9.2": [ { "comment_text": "", "digests": { "md5": "376f1db74c633d7ab003a3d83b520574", "sha256": "9031708af91ff9b81e549f439a4b7c7ac750e219b5666921be784b69e4aaed1b" }, "downloads": -1, "filename": "dlint-0.9.2-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "376f1db74c633d7ab003a3d83b520574", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 74004, "upload_time": "2019-11-21T21:12:04", "upload_time_iso_8601": "2019-11-21T21:12:04.997616Z", "url": "https://files.pythonhosted.org/packages/a2/15/56a614ae1ddc15515cb1fa7ec7fb5ab4e5f0c2192ee6d927e0713e31d4c7/dlint-0.9.2-py2.py3-none-any.whl", "yanked": false, "yanked_reason": null } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "3cdd68ebb4150147c95e320b87687db5", "sha256": "344823d299439aa94fe276b2b3b90733026787d25713c664e137cf5f7d0645f7" }, "downloads": -1, "filename": "dlint-0.12.0-py3-none-any.whl", "has_sig": true, "md5_digest": "3cdd68ebb4150147c95e320b87687db5", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 84118, "upload_time": "2021-10-27T13:15:42", "upload_time_iso_8601": "2021-10-27T13:15:42.845122Z", "url": "https://files.pythonhosted.org/packages/45/dd/60b5213a5389cc0fb82b85b1fe71cd5649c6c97d63bfd091b0df752d183e/dlint-0.12.0-py3-none-any.whl", "yanked": false, "yanked_reason": null } ], "vulnerabilities": [] }