fair-software.nl recommendations | Badges |
---|---|
1. Code repository | |
2. License | |
3. Community Registry | |
4. Enable Citation |
This is a package and command-line utility to audit code quality and compliance with best practices.
The package and command-line utility can be installed easily from PyPI using
pip
.
pip install code-auditor
To install a specific version, e.g. v0.2.0, use:
pip install code-auditor==0.2.0
To upgrade to the latest version:
pip install --upgrade code-auditor
For the latest development version, you can install directly from the source:
git clone https://github.com/SS-NES/code-auditor.git
cd code-auditor/
pip install .
Usage: codeauditor [OPTIONS] PATH
Audits the code base, where PATH is the path or URL address of the code base.
Options:
--skip-analyser [change_log|citation|code_markdown|code_python|conduct|contributing|dependency_python|documentation|git|jupyter_notebook|license|notice|packaging_python|testing_python]
List of analysers to skip.
--skip-aggregator [citation|code|community|documentation|license|packaging|repository|testing|version_control|metadata]
List of aggregators to skip.
--skip-type [citation|code|community|dependency|documentation|license|metadata|packaging|publishing|repository|testing|version_control]
List of processor types to skip.
-r, --reference FILENAME Path of the reference metadata for
comparison (e.g. SMP).
-b, --branch TEXT Branch or tag of the remote code repository.
-t, --path-type [zip|tar|tgz|tar.gz|git]
Type of the file located at the path.
-m, --metadata FILENAME Path to store the metadata extracted from
the code base.
-o, --output PATH Path to store the output.
-f, --format [plain|html|json|yaml|markdown|rst|rtf|docx]
Output format. [default: rst]
-p, --plain Enable plain output.
-l, --message-level INTEGER RANGE
Message level. [default: 1; 1<=x<=5]
-d, --debug Enable debug mode.
-v, --version Show the version and exit.
-h, --help Show this message and exit.
Audit the code in the current working directory and display the report in the terminal:
codeauditor .
Audit the code repository of code-auditor and display the report in the terminal:
codeauditor https://github.com/SS-NES/code-auditor
Audit the code repository of code-auditor and save the report as report.docx:
codeauditor https://github.com/SS-NES/code-auditor --format docx --output report.docx
Audit the code in the current working directory and display the report in the terminal:
import codeauditor
# Generate audit report
report = codeauditor.audit('.')
# Get report output as Markdown
out = report.output(format=codeauditor.report.OutputType.MARKDOWN)
# Display output
print(out)
This software was developed as part of the TDCC-NES Bottleneck Project "Best Practices for Sustainable Software" funded by the Thematic Digital Competence Centre (TDCC) for the Natural & Engineering Sciences (NES).