Skip to content

A linting/refactoring library for python best practices and lesser-known tricks

License

Notifications You must be signed in to change notification settings

Tadaboody/good_smell

Repository files navigation

Good Smell - it makes your code smell good!

A linting/refactoring library for python best practices and lesser-known tricks

Build Code style: black PyPi version


This Tool tries to find bits of code that are possible to make more pythonic, more beautiful by using the language features and standard library functions you might not know about

For example Directly nested for loops (nested-for)

for i in seq_a:
    for j in seq_b:
        print(i, j)

will be flattened to a nested comprehension

for i, j in ((i,j) for i in seq_a for j in seq_b):
    print(i, j)

For a full list - check the list of implemented smells

Installing:

pip install good_smell 

Usage

To issue warnings, good_smell installs itself as a flake8 plugin with error codes starting with SML.

To automatically fix the code use good_smell fix:

good_smell fix PATH >PATH
good_smell fix PATH [--starting-line STARTING_LINE] [--end-line END_LINE]

Developing

See contributing guide

About

A linting/refactoring library for python best practices and lesser-known tricks

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages