.napirc

napi's powerful configuration file

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",
  "python": {
    "version": "3.11"
  }
}

Configuration Parameters

Field

Required?

Description

language

True

The programming language to process.

outDir

True

The output folder of extracted code.

python.version

Only for python projects

The version of the language to consider. Only major version is required. (e.g. 2.17, 3.11, etc.)

c.includedirs

Only for C projects

An optional array of directories to include for processing.

project.include

True

Files to include in the audit/visualization process.

project.exclude

True

Files to exclude from the audit/visualization process.

Updated on