Unearthing bad code. Performs regex searches, but with more manageable results.
Project description
Shuvel
Unearthing bad code. Performs regex searches, but with more manageable results.
Installation
Standard Build
pip3 install shuvel
Bleeding Edge Build
pip3 install git+https://gitlab.com/TheTwitchy/shuvel
Development
- It is recommended that you use a virtualenv for development:
virtualenv --python python3 venv
source ./venv/bin/activate
python setup.py develop
- Run with
shuvel
Usage
Running Rulesets
shuvel run -t ~/example/src
- Runs all rules.
shuvel run -t ~/example/src -r general.*
- Runs all rules in the
general
category.
- Runs all rules in the
shuvel run -t ~/example/src -r general.security_words
- Runs only the rule
general.security_words
.
- Runs only the rule
shuvel run -t ~/example/src -r general.security_words,general.rng,other.*
- Runs several rules at once.
shuvel run -t ~/example/src -s low
- Only run rules which will report low severity items or higher. Possible values are
high
,low
, andinfo
.
- Only run rules which will report low severity items or higher. Possible values are
Showing Rulesets
shuvel rules
- Shows all loaded rules.
Writing Rules
Rules are stored locally, and can generally be found in the shuvel
config directory, which can be seen when running shuvel run --help
. Non-default rules directories may be specified on the command line with the -r
option. Rules need to be JSON files which have a structure as shown below (specifically the magic number should be intact, and all rules should be defined as a list under the "rules" field).
Example Rules
See the examples
folder for some possibilities.
Testing Rules
To ensure a rule is valid, run shuvel test
to show any errors or suggestions. The --debug
switch can be passed before the test
command as well for additional output.
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
Built Distribution
File details
Details for the file shuvel-0.4.0.tar.gz
.
File metadata
- Download URL: shuvel-0.4.0.tar.gz
- Upload date:
- Size: 12.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6deb46d7fa27b0af5510f2eba847a997e7a7a54881a08650b40d8f6a773b0a87 |
|
MD5 | dbc466147ecaf8264d8643577cb156db |
|
BLAKE2b-256 | 3e7a4f48666a624c67a21d83ebec052b89888c93311342c78cfd8a7c3c32640b |
File details
Details for the file shuvel-0.4.0-py3-none-any.whl
.
File metadata
- Download URL: shuvel-0.4.0-py3-none-any.whl
- Upload date:
- Size: 9.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8f4240af0114f50e57a301974b7f1d05dc914abc9bb5a196525b85ea63e4ff79 |
|
MD5 | 291e9a680e5a91987bbd0d104ee246e4 |
|
BLAKE2b-256 | 73bd5c46739f342ff0bcc2ec93434da06078a9d57623a615775ef3067fc7c7f2 |