Skip to content

Conversation

@grahamalama
Copy link
Contributor

@grahamalama grahamalama commented Jul 11, 2022

Chatted with @leplatrem about #81, and I added some more changes on top of that PR here.

The idea with this PR is that infra/lint.sh and infra/test.sh are the "source of truth" for how we want to run linting and tests respectively. We then use these scripts in precommit, make, Github Actions, and wherever else we want to run tests and linting.

For Github Actions, we also now run linting and tests directly in the action runner, rather than running through Docker. This resulted in a speed-up of the checks.

Fixes #79
Fixes #67

@grahamalama grahamalama marked this pull request as ready for review July 11, 2022 16:06
@grahamalama grahamalama requested a review from a team as a code owner July 11, 2022 16:06
Copy link
Contributor

@bsieber-mozilla bsieber-mozilla left a comment

Choose a reason for hiding this comment

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

Overall, LGTM--thanks for the consolidation! 👍

@grahamalama
Copy link
Contributor Author

Thanks for the approval @bsieber-mozilla. @leplatrem, looking for your review as well since I built on top of your initial PR.

@grahamalama
Copy link
Contributor Author

(I should really get out of the habit of my rebase on main workflow since it causes me to force push 🤦🏻‍♂️)

Copy link
Contributor

@leplatrem leplatrem left a comment

Choose a reason for hiding this comment

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

Great 🎉

nit: the Github jobs are called lint-build and test-build, which was relevant when we were testing containers. Now they can be rename lint and test IMO

Copy link
Contributor

@leplatrem leplatrem left a comment

Choose a reason for hiding this comment

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

I just realized we exclude tests from certain checks.

When including tests in isort we face the issue I was having, where black unwraps and isort wraps back.

@grahamalama
Copy link
Contributor Author

When including tests in isort we face the issue I was having, where black unwraps and isort wraps back

Something I just had to do that fixed this:

  • make sure you have isort ^5.10.1 installed in your virtualenv
  • make sure you don't have an old .isort.cfg file laying around -- I noticed I still had one in my directory, and I think that was the thing that was causing problems since that will take precedence over pyproject.toml if it's present.

I think when we do that, isort will respect the "black" profile in pyproject.toml

@grahamalama grahamalama merged commit b8dc0b5 into mozilla:main Jul 12, 2022
@grahamalama grahamalama deleted the align-test-lint branch July 12, 2022 15:28
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.

make lint is too slow Code coverage error

3 participants