Added knip config and action for unused files/exports - #90642
Conversation
|
|
|
@QichenZhu Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
@roryabraham @Julesssss This PR adds the final knip config + action that will run on every PR. Please merge the PR with failing check as it will be stabilised once PR hits main |
|
@MelvinBot Write up a slack post that will tell the users about knip and how to resolve knip errors. Take reference of this PR for help |
|
Here's a draft Slack post about knip: 🔍 New CI Check: Knip (unused code detection) We've added knip to our CI pipeline. It automatically detects unused files, exports, types, and dependencies in the codebase. Starting now, PRs that introduce new unused code will fail the "Knip check" CI step. Important: knip will NOT fail on pre-existing unused code — it only compares your PR against Common knip errors and how to fix them:
How to debug locally: # Run knip and see all current issues (JSON output):
KNIP=true npx knip --reporter json --no-exit-code > /tmp/knip-pr.json
# Or for a human-readable view:
KNIP=true npx knipHow the CI check works:
What if knip flags something that's actually used? Some code is used dynamically or by external tools that knip can't trace. In those cases, update Reference PR: #90642 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b13fadf95b
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Julesssss
left a comment
There was a problem hiding this comment.
Could you merge main and resolve the current check failures please
roryabraham
left a comment
There was a problem hiding this comment.
Also, let's add some documentation to a README
roryabraham
left a comment
There was a problem hiding this comment.
Meant to request changes
That makes sense I think. Once we merge this PR, main will become the baseline. But we don't need to get knip passing on this PR necessarily |
Co-authored-by: Shubham Agrawal <58412969+shubham1206agra@users.noreply.github.com>
|
@roryabraham changes since your last review feedback |
|
@roryabraham looks like this was merged without a test passing. Please add a note explaining why this was done and remove the |
|
🚧 @roryabraham has triggered a test Expensify/App build. You can view the workflow run here. |
|
knip was failing but should pass on other PRs after merging |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/roryabraham in version: 9.3.91-0 🚀
Bundle Size Analysis (Sentry): |
|
🤖 No help site changes required — no draft PR created. I reviewed the changes in this PR and there is nothing to document on the help site under Why: This PR is an internal developer-tooling change. It:
There are no user-facing changes: no modifications to @shubham1206agra, if you believe a user-facing behavior was actually changed by this PR and should be documented, let me know and I'll create the draft help site PR. |
|
Hi @shubham1206agra @JS00001 Is it enough tests included in the regression, let me know please? Thank you |
|
@izarutskaya You can do normal QA tests here. If anything pops out of ordinary, we will detect it. |
|
🚀 Deployed to staging by https://github.com/roryabraham in version: 9.3.94-0 🚀
Bundle Size Analysis (Sentry): |
|
🤖 No help site changes required. I reviewed the changes in this PR and confirmed that no updates to Expensify's help site files under Why: This is a developer-tooling / code-quality change with no user-facing impact. It:
None of these changes add, remove, or modify any product feature, UI label, setting, or workflow that an end user would interact with. The linked issue #86254 is scoped as an Engineering "Task" (Knip audit), not a feature change. The help site documents user-facing product behavior, which is unchanged here. @shubham1206agra — since there are no user-facing changes, there's no help site PR to review. If you believe a specific user-facing behavior was affected that I missed, reply with the detail and I'll take another look. |
|
🚀 Deployed to production by https://github.com/luacmartins in version: 9.3.94-0 🚀
|
Explanation of Change
Fixed Issues
$ #86254
Tests
Please run smoke tests of the main flow: Sign in, Create Expense, Submit, etc
Offline tests
Same as Tests
QA Steps
Same as Tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.