fsouza / autoflake8 Goto Github PK
View Code? Open in Web Editor NEWTool to automatically fix some issues reported by flake8 (previously forked from autoflake).
License: MIT License
Tool to automatically fix some issues reported by flake8 (previously forked from autoflake).
License: MIT License
When there are multiple files containing unused imports/variables, the output is written as one line.
file1.py: Unused imports/variables detectedfile2.py: Unused imports/variables detectedfile3.py: Unused imports/variables detectedfile4.py: Unused imports/variables detected
Would be easier to read if each was on its own line:
file1.py: Unused imports/variables detected
file2.py: Unused imports/variables detected
file3.py: Unused imports/variables detected
file4.py: Unused imports/variables detected
fix.py should have a trailing \n
While at it, rename the entrypoint to autoflake8
.
While testing autoflake8
behavior, it seems that it always assumes unused import on __init__.py
really unused. Contrary, importing constant on __init__.py
is a reasonable practice. You should preserve --ignore-init-module-imports
.
Tried and reverted it, see CI failure: https://github.com/fsouza/autoflake8/runs/3806980380?check_suite_focus=true
Should also move it into a package.
As we split it, we should make relevant changes in the autoflake_test.py file too.
test_fuzz is great, but it's too slow. We should split it in two components and make it concurrent: one that walks the filesystem and another one actually executes autoflake.
Could be two asyncio.Queue
s and a configurable number of workers working on them.
I don't know how to increase verbosity as said by the README. I've tested:
--remove-unused-variables -vvv tests/test_fib.py
--remove-unused-variables -v -v -v tests/test_fib.py
--remove-unused-variables -v tests/test_fib.py
All of them have same verbosity, that is: Fixed tests/test_fib.py
_
How to print the modification that had been done and what rule is violated?
Running autoflake8 on scripts will remove the executable bit.
(thanks for the tool!)
Is there any example implementing arguments in .pre-commit-config.yaml
or preferably pyproject.toml
?
I'm using:
- repo: https://github.com/fsouza/autoflake8
rev: v0.3.2
hooks:
- id: autoflake8
args: [--recursive --in-place --remove-unused-variables]
But returns error:
No such file or directory: '--recursive --in-place --remove-unused-variables'
This is more exploratory than real, but it'd be nice to not rely on regular expressions for fixing issues.
isort
can be imported as a package and then work on the given file or code (see docs). It would be very convenient to have the similar feature for autoflake8
At the end of a successful run, it would be nice to output a message, similar to what black does.
All done! ✨ 🍰 ✨
41 files would be left unchanged.
When I run autoflake8 on a directory that has no issues, I don't get any confirmation that it actually ran.
autoflake8
did not fix E303 too many blank lines
There aren't many dependencies (just pytest I think?), but we should have an easy way of knowing what's needed to run the tests locally.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.