siderolabs / conform

Policy enforcement for your pipelines.
Mozilla Public License 2.0
432 stars 45 forks source link

feat: add support for multiple licenses #250

Closed utkuozdemir closed 8 months ago

utkuozdemir commented 8 months ago

feat: add support for multiple licenses

Allow specifying multiple policy documents of type: commit in .conform.yaml.

Join these multiple policy declarations into a single license check policy.

In the license check spec, introduce a new field, root, to allow specifying in which directory that license check should run.

With this change, a single repository will be able to have different license rules for different paths.

Sample conform file with the changes:

policies:
  - type: commit
    spec: "..."
  - type: license
    spec:
      includeSuffixes:
        - .go
      excludeSuffixes:
        - .pb.go
        - .pb.gw.go
      header: "// ROOT LICENSE"
  - type: license
    spec:
      root: staging/client/
      includeSuffixes:
        - .go
      excludeSuffixes:
        - .pb.go
        - .pb.gw.go
      header: "// SUBDIR LICENSE"
utkuozdemir commented 8 months ago

/m