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

Add CI job to make easier to spot linting issues #1262

Merged
merged 1 commit into from
Jun 10, 2021

Conversation

gonzalo-bulnes
Copy link
Contributor

@gonzalo-bulnes gonzalo-bulnes commented May 30, 2021

Description

Adds a Run lint jobs to the CI pipeline, to make it easier to spot linting issues.

  • I added the job to the test-buster group to take advantage of the fact that dependencies need to be installed for testing purposes.
    • Trade-off: while a separate lint-buster group could run concurrently, I don't like much the idea of spending CPU cycles downloading and installing dependencies too often. YMMV
  • I added the job after Run tests, because I'd likely fix the test suite first, then lint the code.
    • Note that on the other hand, linting is significantly faster than running the test suite. Depending on how automated code formatting / import sorting is in people's editors, it may be nicer to fail fast.
  • I added the checks in the order they were run in make check.

Fixes #1212

Test Plan

  • Review the position of the Run lint job in the CI pipeline
  • Review the list of linting tasks
  • Review the order of the linting tasks
  • Check that you can make the job fail when expected
  • Is Run lint an adequate name?

Checklist

If these changes modify code paths involving cryptography, the opening of files in VMs or network (via the RPC service) traffic, Qubes testing in the staging environment is required. For fine tuning of the graphical user interface, testing in any environment in Qubes is required. Please check as applicable:

  • I have tested these changes in the appropriate Qubes environment
  • I do not have an appropriate Qubes OS workstation set up (the reviewer will need to test these changes)
  • These changes should not need testing in Qubes

If these changes add or remove files other than client code, the AppArmor profile may need to be updated. Please check as applicable:

  • I have updated the AppArmor profile
  • No update to the AppArmor profile is required for these changes
  • I don't know and would appreciate guidance

If these changes modify the database schema, you should include a database migration. Please check as applicable:

  • I have written a migration and upgraded a test database based on main and confirmed that the migration applies cleanly
  • I have written a migration but have not upgraded a test database based on main and would like the reviewer to do so
  • I need help writing a database migration
  • No database schema changes are needed

@gonzalo-bulnes gonzalo-bulnes marked this pull request as ready for review May 30, 2021 03:22
@gonzalo-bulnes gonzalo-bulnes requested a review from a team as a code owner May 30, 2021 03:22
.circleci/config.yml Outdated Show resolved Hide resolved
@@ -89,6 +98,7 @@ jobs:
- checkout
- run: sudo apt-get install -y sqlite3 libqt5x11extras5
- *run_tests
- *run_lint
Copy link
Contributor

Choose a reason for hiding this comment

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

we can always switch this later to run linters before tests if it causes headache. you've already mentioned the tradeoff here, so let's see how it goes as is!

@gonzalo-bulnes
Copy link
Contributor Author

@creviera I grouped linting and static analysis as you suggested, and rebased. (Removing run_static_analysis made the diff a lot harder to follow. 🙁)

Copy link
Contributor

@sssoleileraaa sssoleileraaa left a comment

Choose a reason for hiding this comment

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

changes lgtm. thanks @gonzalo-bulnes!

@sssoleileraaa sssoleileraaa merged commit 8e6ece0 into freedomofpress:main Jun 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create a CI job to make it easier to spot linter issues
2 participants