-
Notifications
You must be signed in to change notification settings - Fork 106
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
Feature/license checker #220
Conversation
…back from temporal
… to get unmodified license generation working.
…nge back to 2020 only
…s are kept up to date.
…lint rule to run over LICENSE file and report any violations. Updated eslintrc comments with some links to open issue with header plugin requesting for named capture group to be supported in template.
// |
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 file is now auto-generated from lint plugin.
' THE SOFTWARE.' | ||
], | ||
2 | ||
], |
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.
configuration rules for injecting license into headers.
@@ -8,7 +8,7 @@ | |||
"clean": "rm -rf dist", | |||
"dev": "NODE_ENV=development node server.js", | |||
"lint": "npm run lint:check -- --fix", | |||
"lint:check": "eslint --ext .js,.vue client server", | |||
"lint:check": "eslint --ext .js,.vue client server LICENSE", |
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.
adds linter for LICENSE file at root. This will allow auto-generation for LICENSE. Will also fail lint if changed and not passing linting rules.
@@ -101,6 +101,7 @@ | |||
"eslint-plugin-chai-friendly": "^0.5.0", | |||
"eslint-plugin-cup": "^2.0.2", | |||
"eslint-plugin-flowtype": "^4.6.0", | |||
"eslint-plugin-header": "just-at-uber/eslint-plugin-header#ef55ce547ecb6801da326c75374711f0865a57a6", |
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.
Pinned to fork of eslint-plugin-header repo. Waiting for maintainer to merge PR. Can see open PR here:
Stuk/eslint-plugin-header#32
Will create new PR once fork changes are merged back.
This change introduces a new lint plugin which checks if a source file does not have a license in the header of the file.
It will fail CI build pipeline if it detects that a file has a missing license.
It is a quick fix to fix this issue by running command
npm run lint
which will auto-fix this by injecting a license into the files with a missing license (see.eslintrc.js
for configuration).This PR contains the lint plugin change + LICENSE + all changes to source files which are violating a missing license in the header of the file. I have added LICENSE to linting rules so it automatically gets updated when year ends also.
Examples
These examples are committed into the repository and has the linter passed over it. It ensures that these rules are covered and passes lint. If these start to fail, it will also mean that there could be other files that are failing also which need updating (for example year ends and will mark all files as failed if not containing the next year).
License for file not existing in
uber/cadence-web
which is copied from another company (temporal for example)License for file existing in
uber/cadence-web
but modified by another company (temporal for example) and merged changes backLicense for file existing in
uber/cadence-web
with no modifications by another companyLicense for new file created in
uber/cadence-web
with no modifications by another company