Skip to main content

A Python application for tracking, reporting on timing and complexity in tests and applications.

Project description

wily

A Python application for tracking, reporting on timing and complexity in tests and applications.

Build Status codecov

wily [a]:
quick to think of things, having a very good understanding of situations and possibilities, 
and often willing to use tricks to achieve an aim.

Wily uses git to go through each revision (commit) in a branch and run complexity and code-analysis metrics over the code. You can use this to limit your code or report on trends for complexity, length etc.

Usage

Wily can be used via a command line interface, wily.

 $ wily --help
 

Configuration

You can put a wily.cfg file in your project directory and wily will override the runtime settings. Here are the available options:

# list of operators, choose from cyclomatic, maintainability, mccabe and raw
operators = cyclomatic,raw
# archiver to use, defaults to git
archiver = git
# path to analyse, defaults to .
path = /path/to/target
# max revisions to archive, defaults to 50
max_revisions = 20

You can also override the path to the configuration with the --config flag on the command-line.

Command line usage

wily build

The first step to using wily is to build a wily cache with all of the statistics of your project.

Usage: wily build [OPTIONS]

  Build the wily cache

Options:
  -h, --max-revisions INTEGER  The maximum number of historical commits to
                               archive
  -p, --path PATH              Root path to the project folder to scan
  -t, --target PATH            Subdirectories or files to scan
  -o, --operators TEXT         List of operators, seperated by commas
  --help                       Show this message and exit.

By default, wily will assume your project folder is a git directory. Wily will not build a cache if the working copy is dirty (has changed files not commited).

 $ wily build

For a specific directory

 $ wily build -p path/to/folder

Limit the number of revisions (defaults to 50).

 $ wily build --max-revisions=10                       
Found 10 revisions from 'git' archiver in ..
Running operators - cyclomatic,raw,maintainability
Processing |################################| 30/30
Completed building wily history, run `wily report` or `wily show` to see more.

wily index

Show information about the build directory. Requires that .wily/ exists.

Usage: wily index [OPTIONS]

  Show the history archive in the .wily/ folder.

Options:
  --help  Show this message and exit.

wily index will print the configuration to the screen and list all revisions that have been analysed and the operators used.

 $ wily index
--------Configuration---------
Path: .
Archiver: git
Operators: {'cyclomatic', 'raw', 'maintainability'}

-----------History------------
╒══════════════════════════════════════════╤══════════════╤════════════╕
│ Revision                                 │ Author       │ Date       │
╞══════════════════════════════════════════╪══════════════╪════════════╡
│ e8110e550ed018738e9c4e2e573cd2bdc2402ad0 │ Anthony Shaw │ 2018-10-15 │
├──────────────────────────────────────────┼──────────────┼────────────┤
│ d639f1d274cf16d92f74c38fc6cfbee9fa4872bb │ Anthony Shaw │ 2018-10-15 │
├──────────────────────────────────────────┼──────────────┼────────────┤
│ 3e8af55e0f0300013fb621fe93628173907b263e │ Anthony Shaw │ 2018-10-15 │
├──────────────────────────────────────────┼──────────────┼────────────┤
│ 86484e5c33fe11d930be05e9d727846af106af34 │ Anthony Shaw │ 2018-10-15 │
├──────────────────────────────────────────┼──────────────┼────────────┤
│ 3cfe33daa87cb28f0b89c1fd84e1d2c42d7613e9 │ Anthony Shaw │ 2018-10-15 │
├──────────────────────────────────────────┼──────────────┼────────────┤
│ 14e31c613f094c24171e0be3448a8543e73db996 │ Anthony Shaw │ 2018-10-15 │
├──────────────────────────────────────────┼──────────────┼────────────┤
│ 267b91abefb8b47a7bbed7d08889644ced691774 │ Anthony Shaw │ 2018-10-15 │
├──────────────────────────────────────────┼──────────────┼────────────┤
│ 98a95a28e4753a3b783788a2208994b69d4f6b99 │ Anthony Shaw │ 2018-10-15 │
├──────────────────────────────────────────┼──────────────┼────────────┤
│ 8d8da4e1e3fdf0642693ca104d5e4b33ce0b5fad │ Anthony Shaw │ 2018-10-15 │
├──────────────────────────────────────────┼──────────────┼────────────┤
│ 7ac596ee04c2cc86b0f3aa8d7159535834befd59 │ Anthony Shaw │ 2018-10-15 │
╘══════════════════════════════════════════╧══════════════╧════════════╛

wily list-metrics

List the metrics available in the Wily operators. Each one of the metrics can be used in wily graph and wily report

 $ wily list-metrics
mccabe operator:
No metrics available
raw operator:
╒═════════════════╤══════════════════════╤═══════════════╤══════════════════════════╕
│                 │ Name                 │ Description   │ Type                     │
╞═════════════════╪══════════════════════╪═══════════════╪══════════════════════════╡
│ loc             │ Lines of Code        │ <class 'int'> │ MetricType.Informational │
├─────────────────┼──────────────────────┼───────────────┼──────────────────────────┤
│ lloc            │ L Lines of Code      │ <class 'int'> │ MetricType.Informational │
├─────────────────┼──────────────────────┼───────────────┼──────────────────────────┤
│ sloc            │ S Lines of Code      │ <class 'int'> │ MetricType.Informational │
├─────────────────┼──────────────────────┼───────────────┼──────────────────────────┤
│ comments        │ Multi-line comments  │ <class 'int'> │ MetricType.Informational │
├─────────────────┼──────────────────────┼───────────────┼──────────────────────────┤
│ multi           │ Multi lines          │ <class 'int'> │ MetricType.Informational │
├─────────────────┼──────────────────────┼───────────────┼──────────────────────────┤
│ blank           │ blank lines          │ <class 'int'> │ MetricType.Informational │
├─────────────────┼──────────────────────┼───────────────┼──────────────────────────┤
│ single_comments │ Single comment lines │ <class 'int'> │ MetricType.Informational │
╘═════════════════╧══════════════════════╧═══════════════╧══════════════════════════╛
cyclomatic operator:
No metrics available
maintainability operator:
╒══════╤═════════════════════════╤═════════════════╤══════════════════════════╕
│      │ Name                    │ Description     │ Type                     │
╞══════╪═════════════════════════╪═════════════════╪══════════════════════════╡
│ rank │ Maintainability Ranking │ <class 'str'>   │ MetricType.Informational │
├──────┼─────────────────────────┼─────────────────┼──────────────────────────┤
│ mi   │ Maintainability Index   │ <class 'float'> │ MetricType.AimLow        │
╘══════╧═════════════════════════╧═════════════════╧══════════════════════════╛

wily report

Show a specific metric for a given file, requires that .wily/ exists

Usage: wily report [OPTIONS] FILE METRIC

  Show a specific metric for a given file.

Options:
  --help  Show this message and exit.

wily report will print the metric and the delta between each revision.

 $ wily report wily/__main__.py raw.loc
-----------History for raw.loc------------
╒══════════════════════════════════════════╤══════════════╤════════════╤═════════════════╕
│ Revision                                 │ Author       │ Date       │ Lines of Code   │
╞══════════════════════════════════════════╪══════════════╪════════════╪═════════════════╡
│ e8110e550ed018738e9c4e2e573cd2bdc2402ad0 │ Anthony Shaw │ 2018-10-15 │ 163 (0)         │
├──────────────────────────────────────────┼──────────────┼────────────┼─────────────────┤
│ d639f1d274cf16d92f74c38fc6cfbee9fa4872bb │ Anthony Shaw │ 2018-10-15 │ 163 (+21)       │
├──────────────────────────────────────────┼──────────────┼────────────┼─────────────────┤
│ 3e8af55e0f0300013fb621fe93628173907b263e │ Anthony Shaw │ 2018-10-15 │ 142 (0)         │
├──────────────────────────────────────────┼──────────────┼────────────┼─────────────────┤
│ 86484e5c33fe11d930be05e9d727846af106af34 │ Anthony Shaw │ 2018-10-15 │ 142 (+14)       │
├──────────────────────────────────────────┼──────────────┼────────────┼─────────────────┤
│ 3cfe33daa87cb28f0b89c1fd84e1d2c42d7613e9 │ Anthony Shaw │ 2018-10-15 │ 128 (0)         │
├──────────────────────────────────────────┼──────────────┼────────────┼─────────────────┤
│ 14e31c613f094c24171e0be3448a8543e73db996 │ Anthony Shaw │ 2018-10-15 │ 128 (0)         │
├──────────────────────────────────────────┼──────────────┼────────────┼─────────────────┤
│ 267b91abefb8b47a7bbed7d08889644ced691774 │ Anthony Shaw │ 2018-10-15 │ 128 (0)         │
├──────────────────────────────────────────┼──────────────┼────────────┼─────────────────┤
│ 98a95a28e4753a3b783788a2208994b69d4f6b99 │ Anthony Shaw │ 2018-10-15 │ 128 (+21)       │
├──────────────────────────────────────────┼──────────────┼────────────┼─────────────────┤
│ 8d8da4e1e3fdf0642693ca104d5e4b33ce0b5fad │ Anthony Shaw │ 2018-10-15 │ 107 (0)         │
├──────────────────────────────────────────┼──────────────┼────────────┼─────────────────┤
│ 7ac596ee04c2cc86b0f3aa8d7159535834befd59 │ Anthony Shaw │ 2018-10-15 │ 107 (0)         │
╘══════════════════════════════════════════╧══════════════╧════════════╧═════════════════╛

wily graph

Similar to wily report but instead of printing in the console, wily will print a graph in a browser.

Credits

"cute animal doing dabbing" Designed by Freepik

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

wily-0.9.0.tar.gz (61.1 kB view details)

Uploaded Source

Built Distribution

wily-0.9.0-py3-none-any.whl (55.1 kB view details)

Uploaded Python 3

File details

Details for the file wily-0.9.0.tar.gz.

File metadata

  • Download URL: wily-0.9.0.tar.gz
  • Upload date:
  • Size: 61.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.19.1

File hashes

Hashes for wily-0.9.0.tar.gz
Algorithm Hash digest
SHA256 bf07a45bd79074c63c3587bb3cc38ee97fc025d8f1e6ea480d605254a4a1f00c
MD5 80b93563c9e6b3f535c2a6ee7f670137
BLAKE2b-256 497055b6374896dd90ad6862a69de36dfa2b9a7de895e5852f8d9265fd6fcec2

See more details on using hashes here.

File details

Details for the file wily-0.9.0-py3-none-any.whl.

File metadata

  • Download URL: wily-0.9.0-py3-none-any.whl
  • Upload date:
  • Size: 55.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.19.1

File hashes

Hashes for wily-0.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bf6d6b33ba6ae1f6c5de64fa4418e2ff9b272ae7b05e62546cc2dbf2ca5f6559
MD5 caa095677f7121ec413a24c00e5849e2
BLAKE2b-256 7f0b4ccd2a9910c09e1a9dcd7ccdfad66ca9fc0c67516923f9a7e9d01dd52b7c

See more details on using hashes here.

Supported by

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