PyCQA / flake8

flake8 is a python tool that glues together pycodestyle, pyflakes, mccabe, and third-party plugins to check the style and quality of some python code.
https://flake8.pycqa.org
Other
3.41k stars 306 forks source link

Should this project contain/support a GitHub Action for Flake8? #686

Closed asottile closed 3 years ago

asottile commented 3 years ago

In GitLab by @cclauss on Feb 13, 2019, 08:04

Should this project contain the code for a simple yet flexible GitHub Action that allows repo maintainers to quickly add automated Flake8 testing on all pull requests submitted to their repos? Putting that code into this repo or another PyCQA repo will focus development efforts on a single, community supported GitHub Action for Flake8 instead of a multitude of homegrown solutions.

Currently you must be in the GitHub Action beta to be able to use Actions.

https://github.com/cclauss/GitHub-Action-for-Flake8

asottile commented 3 years ago

In GitLab by @cclauss on Feb 13, 2019, 08:05

changed title from Should this project contain/support a GitHub Action to Should this project contain/support a GitHub Action{+ for Flake8?+}

asottile commented 3 years ago

In GitLab by @cclauss on Feb 13, 2019, 09:02

changed the description

asottile commented 3 years ago

In GitLab by @sigmavirus24 on Feb 14, 2019, 03:29

I don't have a strong opinion. I think it will be more reasonable to discuss this once GitHub has made Actions GA. They tend to make wild, backwards incompatible changes, while things are in Beta, and I don'to feel like keeping up with any of that.

asottile commented 3 years ago

In GitLab by @asottile on Feb 14, 2019, 07:31

I've put a bit of thought into this and it's going to be really difficult to get right. We ~had a similar setup to this at my current workplace (globally managed "linting container") and while it solved a duplication problem, it created an update-hell problem.

Notably, whenever we wanted to use a newer version of flake8 we'd either be stuck or we'd break 300+ repositories. It just wasn't feasible to have a centrally managed global container. What we ended up doing was configuring pre-commit for each repository (such that they could pick their local configurations of linters) and then providing a global pre-commit container to run those configurations. Consuming repos could then update at whatever cadence they wanted.

To be honest, I haven't looked that much into github actions myself so it's possible that I'm missing something but my cursory look didn't turn up any way to version things :(

asottile commented 3 years ago

In GitLab by @sobolevn on Nov 11, 2019, 06:07

You can use wemake-python-styleguide as an example for building custom Github Actions.

Links:

Снимок_экрана_2019-11-11_в_17.08.49

asottile commented 3 years ago

In GitLab by @asottile on Jan 16, 2020, 14:47

I'm not sure what this action would do other than exec flake8 . -- I don't think that's particularly useful so I'm going to close this as wontfix

asottile commented 3 years ago

In GitLab by @asottile on Jan 16, 2020, 14:47

closed

asottile commented 3 years ago

In GitLab by @sobolevn on Jan 17, 2020, 01:27

Just for the record: one can use reviewdog together with flake8 to get this result:

reviewdog

It is already bundled with wemake-python-styleguide, here's the source code for the action: https://github.com/wemake-services/wemake-python-styleguide/blob/master/scripts/entrypoint.sh

Docs: https://wemake-python-stylegui.de/en/latest/pages/usage/integrations/github-actions.html