{"repo":"PyCQA/autoflake","free":true,"listed":false,"github":"https://github.com/PyCQA/autoflake","clone":"git clone https://github.com/PyCQA/autoflake.git","description":"Removes unused imports and unused variables as reported by pyflakes","language":"Python","stars":953,"topics":["python","formatter","linter","pyflakes","hacktoberfest"],"license":"MIT","category":"dev-tools","readme_excerpt":"autoflake Introduction autoflake removes unused imports and unused variables from Python code. It makes use of pyflakes to do this. By default, autoflake only removes unused imports for modules that are part of the standard library. (Other modules may have side effects that make them unsafe to remove automatically.) Removal of unused variables is also disabled by default. autoflake also removes useless pass statements by default. Example Running autoflake on the below example results in Installation Advanced usage To allow autoflake to remove additional unused imports (other than than those from the standard library), use the --imports option. It accepts a comma-separated list of names: To remove all unused imports (whether or not they are from the standard library), use the --remove-all-unused-imports option. To remove unused variables, use the --remove-unused-variables option. Below is the full listing of options: To ignore the file, you can also add a comment to the top of the file: Configuration Configure default arguments using a pyproject.toml file: Or a setup.cfg file: The name of the configuration parameters match the flags (e.g. use the parameter expand-star-imports for the flag --expand-star-imports ). Tests To run the unit tests:: There is also a fuzz test, which runs against any collection of given Python files. It tests autoflake against the files and checks how well it does by running pyflakes on the file before and after. The test fails if the pyflakes results ","default_branch":null,"files":null,"tree":[],"storefront":"/r/PyCQA","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/PyCQA/autoflake/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}