Skip to content

Latest commit

 

History

History

use-module-2

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Use Module

There are several styles to use modules.

1. string style

This is the simplest style.

{
  modules: [
    'github_archive/github.com/lintnet-modules/ghalint/workflow/action_ref_should_be_full_length_commit_sha/main.jsonnet@0d6f9c5dbc856a70fca35511136d4f1c3195c872:v0.3.1',
  ],
}

2.1. Object style

{
  modules: [
    {
      path: 'github_archive/github.com/lintnet-modules/ghalint/workflow/action_ref_should_be_full_length_commit_sha/main.jsonnet@0d6f9c5dbc856a70fca35511136d4f1c3195c872:v0.3.1',
    },
  ],
}

Object style supports passing config parameter.

{
  modules: [
    {
      path: 'github_archive/github.com/lintnet-modules/ghalint/workflow/action_ref_should_be_full_length_commit_sha/main.jsonnet@0d6f9c5dbc856a70fca35511136d4f1c3195c872:v0.3.1',
      config: {
        excludes: [
          'slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml',
        ],
      },
    },
  ],
}

2.2. files

You can specify file paths in a module with the attriute files. This style is useful to specify multiple file path patterns in a module and set config parameter by lint rule.

{
  modules: [
    {
      path: 'github_archive/github.com/lintnet-modules/ghalint@0d6f9c5dbc856a70fca35511136d4f1c3195c872:v0.3.1',
      files: [
        'workflow/**/main.jsonnet',
        '!workflow/action_ref_should_be_full_length_commit_sha/main.jsonnet',
        {
          path: 'workflow/action_ref_should_be_full_length_commit_sha/main.jsonnet',
          config: {
            excludes: [
              'slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml',
            ],
          },
        },
      ],
    },
  ],
}