Skip to main content

No project description provided

Project description

pcsFilter

Tool for filtering out Python Code Smells by formatting the code and checking the code style after.


pcsFilter is a wrapper around the following tools:

  1. blue
  2. isort
  3. flake8
  4. radon ("cc" command)

pcsFilter runs mentioned tools in a given order. The following functionality is applied on top:

  1. flake8 number of issues with details and radon cc score are saved upon the first run to ./.pcsFilter folder. The ./.pcsFilter folder path is default and can be overriden via the output path option (-o or --output-path).
  2. When pcsFilter is executed again the new results are compared with the previous ones.
  3. If new results are worse then:
    1. a short message will be printed
    2. if "strict" (-s or --strict) option is used then:
      • pcsFilter will exit with status = 1
  4. New scores and their details will be saved to a default or given output path.

Usage

Shell

Installation

pip install pcsFilter

Base command

pcsFilter <path to project or file>

Strict

Fail with status = 1, when new scores are worse. Has no effect during the first run.

pcsFilter -s <path to project or file>
pcsFilter --strict <path to project or file>

Override output path

Default output path is ./.pcsFilter. It can be overriden the following way:

pcsFilter -o <new output path> <path to project or file>
pcsFilter --output-path <new output path> <path to project or file>

Help message

pcsFilter --help

Docker

Installation

docker pull alexdbondarev/pcsfilter:latest

Base command

docker run --rm -v $(PWD):/project -it alexdbondarev/pcsfilter:latest <path to project or file>

Strict

Fail with status = 1, when new scores are worse. Has no effect during the first run.

docker run --rm -v $(PWD):/project -it alexdbondarev/pcsfilter:latest -s <path to project or file>
docker run --rm -v $(PWD):/project -it alexdbondarev/pcsfilter:latest --strict <path to project or file>

Override output path

Default output path is ./.pcsFilter. It can be overriden the following way:

docker run --rm -v $(PWD):/project -it alexdbondarev/pcsfilter:latest -o <new output path> <path to project or file>
docker run --rm -v $(PWD):/project -it alexdbondarev/pcsfilter:latest --output-path <new output path> <path to project or file>

Help message

docker run --rm -v $(PWD):/project -it alexdbondarev/pcsfilter:latest --help

Contributing

Any contribution is always welcome!
Please follow this code of conduct.
This doc explains contribution details.

Project details


Download files

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

Source Distribution

pcsfilter-1.0.4.tar.gz (7.5 kB view hashes)

Uploaded Source

Built Distribution

pcsfilter-1.0.4-py3-none-any.whl (11.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page