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

fix: restrict eslint license header year update to staged files #504

Merged
merged 9 commits into from
Jan 2, 2025
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ jobs:
run: cd frontend && npm run typecheck

- name: 🖋️ ESLint checks for widget ...
run: cd widget && npm run lint
run: cd widget && npx lint-staged

- name: 🖋️ ESLint checks for Frontend ...
run: cd frontend && npm run lint
run: cd frontend && npx lint-staged

- name: 🛠️ build Widget ...
run: cd widget && npm run build
Expand Down Expand Up @@ -58,7 +58,7 @@ jobs:
run: cd api && npm run typecheck

- name: 🖋️ ESLint checks for API ...
run: cd api && npm run lint
run: cd api && npx lint-staged

- name: 🔬 running unit tests for API ...
run: cd api && npm run test
Expand Down
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ run_checks() {
echo "${BLUE}Running ${path} checks and tests...${NC}"
cd ./${path}
npm run typecheck
npm run lint
npx lint-staged
if [ "$path" = "api" ]; then
npm run test:half # Run API specific tests
fi
Expand Down
1 change: 1 addition & 0 deletions api/.dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Dockerfile
Dockerfile.base
.env
.eslintrc.js
.eslintrc-staged.js
.git
.gitignore
.husky
Expand Down
21 changes: 21 additions & 0 deletions api/.eslintrc-staged.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
module.exports = {
extends: './.eslintrc.js',
rules: {
'header/header': [
2,
'block',
[
'',
' * Copyright © ' +
new Date().getFullYear() +
' Hexastack. All rights reserved.',
' *',
' * Licensed under the GNU Affero General Public License v3.0 (AGPLv3) with the following additional terms:',
' * 1. The name "Hexabot" is a trademark of Hexastack. You may not use this name in derivative works without express written permission.',
' * 2. All derivative works must include clear attribution to the original creator and software, Hexastack and Hexabot, in a prominent location (e.g., in the software\'s "About" section, documentation, and README file).',
' ',
],
2,
],
},
};
22 changes: 13 additions & 9 deletions api/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module.exports = {
tsconfigRootDir: __dirname,
sourceType: 'module',
},
plugins: ['@typescript-eslint/eslint-plugin', 'import', 'license-header'],
plugins: ['@typescript-eslint/eslint-plugin', 'import', 'header'],
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
Expand Down Expand Up @@ -71,19 +71,23 @@ module.exports = {
},
},
],
'license-header/header': [
'error',
'header/header': [
2,
'block',
[
'/*',
' * Copyright © ' +
new Date().getFullYear() +
' Hexastack. All rights reserved.',
'',
{
pattern:
'^ \\* Copyright © 20\\d{2} Hexastack. All rights reserved.$',
template: ' * Copyright © 2025 Hexastack. All rights reserved.',
},
' *',
' * Licensed under the GNU Affero General Public License v3.0 (AGPLv3) with the following additional terms:',
' * 1. The name "Hexabot" is a trademark of Hexastack. You may not use this name in derivative works without express written permission.',
' * 2. All derivative works must include clear attribution to the original creator and software, Hexastack and Hexabot, in a prominent location (e.g., in the software\'s "About" section, documentation, and README file).',
' */',
' ',
],
2,
],
},
};
};
Loading
Loading