Skip to content

Commit

Permalink
Closes #56
Browse files Browse the repository at this point in the history
Unify frontend and backend checker for licenses.
  • Loading branch information
Sojusan committed Jul 31, 2023
1 parent 73868d6 commit 48600cb
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint-and-test-frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:

- name: Check licenses
working-directory: ./frontend
run: npm run license-checker
run: npm run license-checker-linux

- name: Lint
working-directory: ./frontend
Expand Down
10 changes: 10 additions & 0 deletions backend/allowed-licenses.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
[
"MIT",
"ISC",
"Apache-2.0",
"BSD-3-Clause",
"BSD-2-Clause",
"CC0-1.0",
"0BSD",
"Python-2.0",
"MPL-2.0",
"CC-BY-4.0",
"CC-BY-3.0",
"EULA.md",
"PostgreSQL"
]
1 change: 1 addition & 0 deletions frontend/allowed-licenses.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
MIT;ISC;Apache-2.0;BSD-3-Clause;BSD-2-Clause;CC0-1.0;0BSD;Python-2.0;MPL-2.0;CC-BY-4.0;CC-BY-3.0;"EULA.md";"PostgreSQL"
1 change: 1 addition & 0 deletions frontend/licenses-exclude-packages.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[email protected]
3 changes: 2 additions & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"format": "prettier --write .",
"test": "vitest",
"coverage": "vitest run --coverage",
"license-checker": "license-checker --excludePackage \"[email protected]\" --summary --onlyAllow \"MIT;ISC;Apache-2.0;BSD-3-Clause;BSD-2-Clause;CC0-1.0;0BSD;Python-2.0;MPL-2.0;CC-BY-4.0;CC-BY-3.0\""
"license-checker-linux": "license-checker --excludePackage $(cat licenses-exclude-packages.txt) --summary --onlyAllow $(cat allowed-licenses.txt)",
"license-checker-windows": "cd scripts && windows_check_licenses.bat"
},
"dependencies": {
"@emotion/react": "^11.10.5",
Expand Down
4 changes: 4 additions & 0 deletions frontend/scripts/windows_check_licenses.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
cd .. &&^
for /f "usebackq tokens=*" %%a in (`type allowed-licenses.txt`) do echo %%a &&^
for /f "usebackq tokens=*" %%b in (`type licenses-exclude-packages.txt`) do echo %%b &&^
license-checker --excludePackage %%b --summary --onlyAllow %%a

0 comments on commit 48600cb

Please sign in to comment.