-
Notifications
You must be signed in to change notification settings - Fork 70
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
Integrate Knip #7847
base: develop
Are you sure you want to change the base?
Integrate Knip #7847
Conversation
Oops! Looks like you forgot to update the changelog. When updating CHANGELOG.md, please consider the following:
|
knip-reporter.ts
Outdated
@@ -0,0 +1,18 @@ | |||
/* |
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.
Do we need this custom reporter? If yes, maybe we could create the file in the pipeline especially given that it would be added to the root of the repository
knip.ts
Outdated
*/ | ||
import type { KnipConfig } from 'knip' | ||
|
||
const config: KnipConfig = { |
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.
Can you supply these options for the knip
command inline so we wouldn't need to add a new file to the root of the project? I'm trying to avoid that as for newcomers these files can feel a bit daunting
.github/workflows/lint-and-test.yml
Outdated
- name: Create reporter | ||
run: echo "const reporter = function (options) {const totalIssues = Object.values(options.issues).reduce((acc, issueRecords) =>acc +Object.values(issueRecords).reduce((acc2, issuesInFile) => acc2 + Object.keys(issuesInFile).length,0),0); console.log(JSON.stringify({ totalIssues }))}; export default reporter" > knip-reporter.js |
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.
- name: Create reporter | |
run: echo "const reporter = function (options) {const totalIssues = Object.values(options.issues).reduce((acc, issueRecords) =>acc +Object.values(issueRecords).reduce((acc2, issuesInFile) => acc2 + Object.keys(issuesInFile).length,0),0); console.log(JSON.stringify({ totalIssues }))}; export default reporter" > knip-reporter.js | |
- name: Create reporter | |
run: | | |
cat << 'EOF' > knip-reporter.js | |
const reporter = function (options) { | |
const totalIssues = Object.values(options.issues).reduce( | |
(acc, issueRecords) => | |
acc + Object.values(issueRecords).reduce( | |
(acc2, issuesInFile) => acc2 + Object.keys(issuesInFile).length, | |
0 | |
), | |
0 | |
); | |
console.log(JSON.stringify({ totalIssues })); | |
}; | |
export default reporter; | |
EOF |
You might be able to do it like this as well
security-scans: | ||
needs: setup | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- name: Run Trivy vulnerability scanner in fs mode | ||
uses: aquasecurity/[email protected] | ||
with: | ||
scan-type: 'fs' | ||
scan-ref: '.' | ||
trivy-config: trivy.yaml |
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.
security-scans: | |
needs: setup | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Run Trivy vulnerability scanner in fs mode | |
uses: aquasecurity/[email protected] | |
with: | |
scan-type: 'fs' | |
scan-ref: '.' | |
trivy-config: trivy.yaml |
@@ -41,11 +41,13 @@ | |||
}, | |||
"devDependencies": { | |||
"@types/dotenv": "^6.1.0", | |||
"@types/node": "^22.7.9", |
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.
"@types/node": "^22.7.9", |
"concurrently": "^8.0.0", | ||
"husky": "^9.1.6", | ||
"lerna": "^8.0.0", | ||
"lint-staged": "^15.2.10", | ||
"prettier": "2.8.8" | ||
"prettier": "2.8.8", | ||
"typescript": "^5.6.3" |
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.
"typescript": "^5.6.3" |
@@ -27,13 +27,6 @@ export const getSystemRolesQuery = gql` | |||
} | |||
` | |||
|
|||
export const updateRoleQuery = gql` |
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.
Please run graphql type generator
@@ -35,56 +23,3 @@ const QueryMapper = { | |||
export const getQueryMapping = (event: Event, action: Action) => { |
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.
Consider moving these somewhere else as well if the component is not used anymore (this being a file for the component originally)
No description provided.