Comments (6)
I just came across this tool and was very exited. But this is a showstopper.
Can you make it configurable to remove 'useless' pass
statements or not? If I run autoflake with --remove-all-unused-imports
I expect to not make any other changes except to the imports.
from autoflake.
This also happens if you use methods decorated with @abc.abstractmethod
: they will typically have a docstring but no implementation.
from autoflake.
...
reads as a placeholder for code that needs to be written, or that it's a ‘template’ ‘blueprint’, e.g. in .pyi
stub files.
pass
in an exception class body means it's intentionally empty. another use case is the click
example and its rationale in my earlier comment.
from autoflake.
Sometimes people use ellipsis ...
in empty functions to mark it as implementation missing, though not sure is that more of a hack, as it has varying semantics depending on where it's used.
Still, I actually prefer using ellipsis in these cases, as it stands out more clear that method/function doesn't have implementation, and autoflake doesn't seem to complain about it either.
from autoflake.
Good explanation, thanks!
from autoflake.
Will this be fixed?
from autoflake.
Related Issues (20)
- Autoflake is removing imports specified in typehint comment HOT 1
- Removing import resorts imports in a way incompatible with isort HOT 3
- Run on jupyter notebook, with .ipynb extension
- Feature request: remove type-checking block instead of inserting pass
- Feature request: remove ellipsis
- (🎁) specify files in config file HOT 1
- Breaking change to configuration logic in v2.1.0 HOT 8
- Don't remove re-exported imports HOT 2
- Crash on specific pattern HOT 1
- MultiProcessing issue HOT 2
- Why remove-all-unused-imports isn't default behavior? HOT 1
- Mark https://pypi.org/project/autoflake8/ as deprecated too? HOT 1
- Avoid copying `py.typed` into site-packages? HOT 1
- Pre-commit hook with --remove-all-unused-imports always passes HOT 2
- Unused submodule imports are left if the top level module is used
- Cannot pass pyproject.toml to --config argument
- UnicodeDecodeError when running pre-commit on Windows with `v2.3.0` HOT 1
- autoflake removing imports that are used inside eval() function HOT 1
- Support exclusion of specific imports HOT 3
- Colored diff output
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from autoflake.