Skip to main content

A linter/refactoring tool to make your code smell better!

Project description

Good Smell - it makes your code smell good!

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

Build Status Code style: black PyPi version codecov


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 using itertools.product

import itertools
for i, j in itertools.product(seq_a, seq_b):
    print(i, j)

For a full list - check the list of implemented smells

Installing:

pip install good_smell 

Usage (Is likely to change when version 1.0 is released):

good_smell warn - Print warnings about smells in the code

good_smell warn PATH
good_smell warn --path PATH

Alternativly you can run it through flake8. Smells will be with the code SMLxxx

good_smell fix - Print a fixed version of the code

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

Developing

See contributing guide

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for good-smell, version 0.13.0
Filename, size File type Python version Upload date Hashes
Filename, size good_smell-0.13.0.tar.gz (7.1 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page