Skip to main content

A tool that inserts "chips" to your code, detecting unused fragments. Might be used for developing, refactoring and manual testing purposes

Project description

👾 Chips

Handsome testing tool. It inserts "chips" to your code, detecting unused fragments. Then shows unused functions in a pretty table.

Visit chips git to see the insights

Installation

Use the package manager pip to install Chips

pip install python-chips

Setup Chips

By default chips setups everything for you, after -s command. If you are running into problems, use args below.

  1. -v --venv <on/off> Defaults to on. Determine whether you are using virtualenv or not. If set to on Chips will search for a virtualenv on a root path. Note: if --venv off, you should run commands below with python -m chips instead of $chips
  2. -p --path <YOUR_VIRTUALENV_PATH> Specify virtualenv path if venv not found
python -m chips -s

Open a new tab in terminal or run source <YOUR_VIRTUALENV_PATH>/bin/activate

Usage

BEFORE YOU START: If you want to fully "chip" a big project (not a single app directory), it's highly recommended to use --auto off with -a command, for improving project performance. Learn more about --auto option below.

  1. Add chips to your project (-a --add)
$chips -a
  1. Use your code (trigger functions in a way: make api requests, click website, etc..)

  2. Generate results file with $chips -rs (only if --auto off on -a). See the generated results at .chipping_results/results.py in a pretty table

_pretty_table.png

  1. Remove chips (-r --remove)
$chips -r

Ignore particular dirs and files

To exclude particular dirs and files from chipping (f.e. tests and manage.py in Django) Chips generates a .chipsignore file, based on your .gitignore. Syntax is the same.

There's a basic excludes list in .chipsignore. You can modify it any time you want.

_chipsignore.png Full ignores list here

Chipping path

Basically Chips are performing on a root path of your project. You can specify a folder or file local path, where you want Chips to perform (add or remove). Use -p --path arg.

$chips -a -p <DESIRED PATH>

Bad performance

If you struggle from a bad performance after chipping, use --auto off to turn off auto generated results

$chips -a --auto off

Then you'll need to generate results manually (-rs --results)

$chips -rs

Chips logging

Choose logging type. Can be applied to remove and add (-rt --result_type)

  1. list (default for add) - list all affected files,
  2. count (default for remove) - print number of files affected,
  3. blind - no output
$chips -a -rt count

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. git here

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

python-chips-1.0.15.tar.gz (11.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

python_chips-1.0.15-py3-none-any.whl (13.0 kB view details)

Uploaded Python 3

File details

Details for the file python-chips-1.0.15.tar.gz.

File metadata

  • Download URL: python-chips-1.0.15.tar.gz
  • Upload date:
  • Size: 11.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.8.2 Darwin/20.6.0

File hashes

Hashes for python-chips-1.0.15.tar.gz
Algorithm Hash digest
SHA256 38a222dcfed01233a80049237b1e72218789503b5897b2e9fa57f4b7cd0220c4
MD5 841e5a81c226abd417805648da583f88
BLAKE2b-256 7945617fc194d8a0bef4512423d4afac1f0131414c24f0c4fbbcfb6cddfcf096

See more details on using hashes here.

File details

Details for the file python_chips-1.0.15-py3-none-any.whl.

File metadata

  • Download URL: python_chips-1.0.15-py3-none-any.whl
  • Upload date:
  • Size: 13.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.8.2 Darwin/20.6.0

File hashes

Hashes for python_chips-1.0.15-py3-none-any.whl
Algorithm Hash digest
SHA256 806cc697bc5c33cd1c494bd7cd117d50e30d3b319af7b47a1b44dcaf4fcddde3
MD5 e959d0c8fb112073d773644cea335df7
BLAKE2b-256 b9f4670007fe0a2414bc7c66d1e8894071160f310f053873a123318e8ce7b266

See more details on using hashes here.

Supported by

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