-
Notifications
You must be signed in to change notification settings - Fork 0
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
chore / CLOUD-25080 / check presence of file headers #22
Conversation
oli-hivemq
commented
Aug 27, 2024
•
edited
Loading
edited
- 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
984ee90
to
f87770c
Compare
const __filename = fileURLToPath(import.meta.url) | ||
const __dirname = path.dirname(__filename) | ||
|
||
const regexToIgnore = [ |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
/(^|\/)\.[^/]*(?:\/[^/]*)*$/
Nice Job Oli! |
… for verifying that all code files start with the right header
1ac60ee
to
15b6919
Compare
There was a problem hiding this 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 = [ |
There was a problem hiding this comment.
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.
/(^|\/)\.[^/]*(?:\/[^/]*)*$/