The .napirc
file lives at the root of your codebase and defines both the settings needed to minimally run the tool, and the parameters within which napi
will assess your codebase for technical debt.
Example File
For a given python project, the file will look like the following. This config is for Apache Airflow.
When running in another directory, the .napirc
needs to be at the root of whatever path you pass to the CLI via the —workdir
command. e.g. napi audit view —workdir=/path/to/airflow
{
"language": "python",
"project": {
"include": [
"airflow-core/src/**/*"
],
"exclude": [
".git/**",
"**/dist/**",
"**/build/**",
"**/__pycache__/**",
"**/*.pyc",
"**/.pytest_cache/**",
"**/venv/**",
"**/.env/**",
"**/*.egg-info/**",
"**/.tox/**",
"**/.coverage",
"**/htmlcov/**",
"**/.mypy_cache/**"
]
},
"outDir": "napi_out",
"metrics": {
"file": {
"maxChar": 5000,
"maxLine": 2000,
"maxDep": 10
},
"symbol": {
"maxChar": 50000,
"maxLine": 200,
"maxDep": 5
}
},
"python": {
"version": "3.11"
}
}
Configuration Parameters
Field | Required? | Description |
---|---|---|
| True | The programming language to process. |
| True | The output folder of extracted code. |
| Only for python projects | The version of the language to consider. Only major version is required. (e.g. |
| True | Files to include in the audit/visualization process. |
| True | Files to exclude from the audit/visualization process. |
| False | A collection of optional settings to give more information to the audit view. |
| False | Informs the audit view which files to highlight as erroring when the number of characters in a file exceeds this limit. |
| False | Informs the audit view which files to highlight as erroring when the number of lines of code in a file exceeds this limit. |
| False | Informs the audit view which files to highlight as erroring when the number of dependencies in a file exceeds this limit. |
| False | Informs the audit view which files to highlight as erroring when the number of characters in a symbol exceeds this limit. |
| False | Informs the audit view which files to highlight as erroring when the number of lines of code in a symbol exceeds this limit. |
| False | Informs the audit view which files to highlight as erroring when the number of dependencies in a symbol exceeds this limit. |