Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a ruletype that checks for the presence of a file header #239

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rdimitrov
Copy link
Member

@rdimitrov rdimitrov commented Dec 19, 2024

The following PR adds a ruletype that checks for the presence of a file header.

It accepts a filter input which is a regex for filtering out files and also the content of the header to check for. Both are required fields.

Example usages:

...
  - type: file_header
    name: enforce-license-header-yml
    def:
      filter: "^.*\\.yml$"
      header: |
        # SPDX-FileCopyrightText: Copyright 2024 The Minder Authors
        # SPDX-License-Identifier: Apache-2.0
  - type: file_header
    name: enforce-license-header-license
    def:
      filter: "LICENSE"
      header: |
        # SPDX-FileCopyrightText: Copyright 2024 The Minder Authors
        # SPDX-License-Identifier: Apache-2.0
...

@rdimitrov rdimitrov requested a review from a team as a code owner December 19, 2024 14:17
@rdimitrov rdimitrov self-assigned this Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants