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

chore / CLOUD-25080 / check presence of file headers #22

Merged
merged 6 commits into from
Aug 28, 2024

Conversation

oli-hivemq
Copy link
Collaborator

@oli-hivemq oli-hivemq commented Aug 27, 2024

  • add a check-header script for verifying that all code files start with the right header
  • add github workflows:
    • unit tests
    • linting
    • check presence of headers with copyright in all files

CleanShot 2024-08-27 at 16 14 07

@oli-hivemq oli-hivemq self-assigned this Aug 27, 2024
@github-actions github-actions bot added the chore label Aug 27, 2024
@oli-hivemq oli-hivemq added the ci label Aug 27, 2024
@oli-hivemq oli-hivemq force-pushed the chore/CLOUD-25080/add-copyright-license-headers branch from 984ee90 to f87770c Compare August 27, 2024 13:30
@oli-hivemq oli-hivemq marked this pull request as ready for review August 27, 2024 14:03
const __filename = fileURLToPath(import.meta.url)
const __dirname = path.dirname(__filename)

const regexToIgnore = [
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do we check its completeness?
For example, a YAML file could be in the code and, supporting comments, could have it's header

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was wondering what should be considered code to be honest. I assumed YAML files were probably not important, tsconfig and vite config files either. Well you've seen the list.
But that's a good question and if you feel like any of the files ignored should have their headers, let me know which ones you'd consider as code and I'll add headers.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd say configuration files yaml, json, toml, or any dotfile should not have the header since some do not event support comments in the first place.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This look great, just one suggestion regarding the dotfiles, something like this might be more appropriate to match cases where the dotfile might be in a folder.
/(^|\/)\.[^/]*(?:\/[^/]*)*$/

check-headers.js Show resolved Hide resolved
@h2xd
Copy link
Collaborator

h2xd commented Aug 28, 2024

Nice Job Oli!

Base automatically changed from fix/CLOUD-25242/semantic-colors-theming-issues to main August 28, 2024 08:23
@oli-hivemq oli-hivemq force-pushed the chore/CLOUD-25080/add-copyright-license-headers branch from 1ac60ee to 15b6919 Compare August 28, 2024 08:26
@oli-hivemq oli-hivemq merged commit cea5c70 into main Aug 28, 2024
6 checks passed
@oli-hivemq oli-hivemq deleted the chore/CLOUD-25080/add-copyright-license-headers branch August 28, 2024 08:29
Copy link

@tolumq tolumq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

const __filename = fileURLToPath(import.meta.url)
const __dirname = path.dirname(__filename)

const regexToIgnore = [
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This look great, just one suggestion regarding the dotfiles, something like this might be more appropriate to match cases where the dotfile might be in a folder.
/(^|\/)\.[^/]*(?:\/[^/]*)*$/

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.

4 participants