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

RSDK-9755 - CLI lint enforce createCommandWithT usage #4803

Merged

Conversation

stuqdog
Copy link
Member

@stuqdog stuqdog commented Feb 20, 2025

Adds a linter step that verifies that all CLI actions are generated with the createCommandWithT helper function.

Tested locally, observed expected linter failure when commands (of the Action, Before, or After variety) were generated without use of createCommandWithT.

Note that I have not removed @viamrobotics/sdk-netcode as a codeowner for cli/app.go. I know that doing so is a goal but I opted for the more conservative approach for now, while we confirm that no additional linter rules are necessary. I don't feel strongly about this though; happy to revisit if anyone else does.

@stuqdog stuqdog requested review from a team, purplenicole730 and lia-viam and removed request for a team February 20, 2025 16:52
@viambot viambot added the safe to test This pull request is marked safe to test from a trusted zone label Feb 20, 2025
@stuqdog stuqdog requested a review from njooma February 20, 2025 16:52
@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Feb 20, 2025
@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Feb 20, 2025
@@ -76,6 +76,12 @@ jobs:
sudo apt-get update && sudo apt-get install -y python3-venv
sudo --preserve-env=MONGODB_TEST_OUTPUT_URI,GITHUB_SHA,GITHUB_RUN_ID,GITHUB_RUN_NUMBER,GITHUB_RUN_ATTEMPT,GITHUB_X_PR_BASE_SHA,GITHUB_X_PR_BASE_REF,GITHUB_X_HEAD_REF,GITHUB_X_HEAD_SHA,GITHUB_REPOSITORY -Hu testbot bash -lc 'make test-go'

- name: Run CLI linter tests
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe lint before running unit tests?

Unit tests take forever, and linting should be fast

@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Feb 25, 2025
@stuqdog stuqdog merged commit 34fb043 into viamrobotics:main Feb 25, 2025
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
safe to test This pull request is marked safe to test from a trusted zone
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants