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

Update and fix Flake8 #1424

Merged
merged 4 commits into from
May 17, 2020
Merged

Update and fix Flake8 #1424

merged 4 commits into from
May 17, 2020

Conversation

hugovk
Copy link
Contributor

@hugovk hugovk commented May 17, 2020

Updates Flake8 (and mypy) in pre-commit.

Fixes new Flake8 warnings:

  • F541 f-string is missing placeholders
  • E741 ambiguous variable name 'l'

Update GHA actions to v2.

@JelleZijlstra JelleZijlstra merged commit 03b8304 into psf:master May 17, 2020
@hugovk hugovk deleted the flake8 branch May 17, 2020 14:19
Copy link
Collaborator

@cooperlees cooperlees left a comment

Choose a reason for hiding this comment

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

Many thanks for cleaning this up - Wonder if we can automate updating Actions + pre-commit or create an issue on CI failure.

@@ -10,10 +10,10 @@ jobs:
python-version: [3.7]

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is there a Tool we can run to check for action upgrades available?

@hugovk
Copy link
Contributor Author

hugovk commented May 17, 2020

Many thanks for cleaning this up - Wonder if we can automate updating Actions + pre-commit or create an issue on CI failure.

GitHub Actions

I couldn't find an existing tool. A DIY solution: parse the YAML file for the used actions, check their repos to see if they have a newer version/tag. Feels like a bit much seeing as they don't change so often.

pre-commit

The issues to +1 for Dependabot to support it:


Also, this is part of the pre-commit author's current project:


Or right now, it's easy to run pre-commit autoupdate and the fail if there's an update that modifies the config file: test $(git status --porcelain| wc -l) = 0

Here's a quick demo:

It's failing because there's a Prettier update (I intentionally omitted it from this PR because the node version on Travis CI would need updating).

It wouldn't make sense to run as part of normal PRs, we don't want to fail someone's unrelated changes. It could be a weekly cron or only on merges to master.

And then perhaps something like https://github.com/JasonEtco/create-an-issue or https://github.com/peter-evans/create-issue-from-file could be used to conditionally create an issue, but we probably wouldn't want that to spam duplicate issues.

Or perhaps something like https://peterevans.dev/posts/github-actions-how-to-automate-code-formatting-in-pull-requests/ to create a PR.

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.

3 participants