Skip to main content

naislinter

A simple Python script to validate that your NAIS yaml file adheres to the NAIS specifications.

GitHub Action

To set up this as a GitHub Action, add the following as a step in your workflow:

    - name: naislint nais.yaml
      uses: nais/naislinter@v1.0.2
      env:
        RESOURCE: nais.yaml

The action follows the same footprint as nais/deploy for injecting variables to templates, however some environment variables are not required, such as APIKEY, CLUSTER.

Local installation

pip install naislinter

Local usage

naislinter nais.yaml

Will print any path in the config tree that falls outside of the spec and return a non-zero code if any were encountered.

Returns 0 if the file is valid according to the NAIS specifications.

Limitations

This does not validate value types, this is not in scope as nais/deploy verifies types and rejects a deployment if the NAIS yaml file is malformed in this fashion.

Additionally, this tool requires a fully formed NAIS yaml file, after any template injections. A file containing {{ image }} will therefore fail, unless the variable has been injected. This is not relevant in the GitHub Action, as template injection happens before naislinter runs.

Finally, in its current state, the tool is unable to verify objects within lists. For instance:

spec:
    env:
        - name: KEY
          value: value
        - name: ANOTHER_KEY
          value: another_value
          key_outside_of_spec: hello!

key_outside_of_spec will not be caught as an error since it's in an object within a list.

Metadata

Release files for naislinter 1.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for naislinter 1.0.3
File Size Uploaded
naislinter-1.0.3.tar.gz 3.1 kB Details

Release files / naislinter-1.0.3.tar.gz

Download URL naislinter-1.0.3.tar.gz
Size 3.1 kB
Tags Source
SHA-256 checksum
How to use checksums
f67110405832978df008745508b7ecc66cbe7d3439d2679ad6b10b3d9a2cc033
BLAKE2b-256 checksum
How to use checksums
14e7ea9de7f4344244e90a51810919310845ba9007c731020e3d2bb1741c6516
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.0

Release history Release notifications | RSS feed

This release

1.0.3 This release

1 release file

1.0.2

1 release file

1.0.1

1 release file

1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page