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

lint: Run pyflakes and pycodestyle via Flake8 #14532

Closed
wants to merge 2 commits into from
Closed

Conversation

andersk
Copy link
Member

@andersk andersk commented Apr 10, 2020

Flake8 automatically gives us support for noqa comments, parallelism, configuration files, plugins, and easy editor integration. Plus, now we can write poems about how to placate Flake8.

@timabbott
Copy link
Sponsor Member

I guess we should turn on parallelism; for hot-cache runtime it's by far the slowest (which is why we had our hacky parallelism before).

(zulip-py3-venv) tabbott@coset:~/zulip$ ./tools/lint --verbose-timing
2020-04-10 00:56:54,135 start css
2020-04-10 00:56:54,136 start eslint
2020-04-10 00:56:54,136 start puppet
2020-04-10 00:56:54,137 start puppet-lint
2020-04-10 00:56:54,137 start templates
2020-04-10 00:56:54,138 start openapi
2020-04-10 00:56:54,139 start shellcheck
2020-04-10 00:56:54,140 start mypy
2020-04-10 00:56:54,142 start flake8
2020-04-10 00:56:54,146 start tsc
2020-04-10 00:56:54,146 start yarn-deduplicate
2020-04-10 00:56:54,149 start gitlint
2020-04-10 00:56:54,155 start custom_nonpy
2020-04-10 00:56:54,150 start sgrep-py
2020-04-10 00:56:54,159 start custom_py
2020-04-10 00:56:54,938 finish openapi
2020-04-10 00:56:55,513 finish gitlint
2020-04-10 00:56:57,776 finish yarn-deduplicate
2020-04-10 00:56:59,263 finish puppet
2020-04-10 00:56:59,649 finish puppet-lint
2020-04-10 00:57:10,823 finish css
2020-04-10 00:57:15,834 finish custom_nonpy
2020-04-10 00:57:18,833 finish shellcheck
2020-04-10 00:57:24,250 finish sgrep-py
2020-04-10 00:57:24,351 finish tsc
2020-04-10 00:57:26,298 finish templates
2020-04-10 00:57:27,019 finish mypy
2020-04-10 00:57:27,519 finish custom_py
2020-04-10 00:57:39,174 finish flake8
2020-04-10 00:57:39,393 finish eslint
(zulip-py3-venv) tabbott@coset:~/zulip$ ./tools/lint --verbose-timing
2020-04-10 00:57:45,197 start css
2020-04-10 00:57:45,198 start eslint
2020-04-10 00:57:45,199 start puppet
2020-04-10 00:57:45,201 start puppet-lint
2020-04-10 00:57:45,202 start templates
2020-04-10 00:57:45,204 start openapi
2020-04-10 00:57:45,205 start shellcheck
2020-04-10 00:57:45,207 start mypy
2020-04-10 00:57:45,209 start flake8
2020-04-10 00:57:45,211 start tsc
2020-04-10 00:57:45,212 start yarn-deduplicate
2020-04-10 00:57:45,213 start gitlint
2020-04-10 00:57:45,216 start sgrep-py
2020-04-10 00:57:45,217 start custom_nonpy
2020-04-10 00:57:45,217 start custom_py
2020-04-10 00:57:45,780 finish openapi
2020-04-10 00:57:46,139 finish gitlint
2020-04-10 00:57:46,812 finish yarn-deduplicate
2020-04-10 00:57:47,857 finish eslint
2020-04-10 00:57:48,219 finish puppet
2020-04-10 00:57:48,427 finish puppet-lint
2020-04-10 00:57:48,723 finish mypy
2020-04-10 00:57:55,551 finish css
2020-04-10 00:58:01,518 finish custom_nonpy
2020-04-10 00:58:02,215 finish shellcheck
2020-04-10 00:58:05,572 finish sgrep-py
2020-04-10 00:58:06,597 finish tsc
2020-04-10 00:58:07,855 finish templates
2020-04-10 00:58:09,058 finish custom_py
2020-04-10 00:58:19,055 finish flake8

@timabbott
Copy link
Sponsor Member

Oh, it is using parallelism -- it's just that flake8 is somehow much slower than the previous setup. That doesn't super make sense to me given that in theory it should be able to do less parsing work than doing pep8 + pyflakes, but the runtime is clearly much longer even when it's using all of my CPUs.

andersk added a commit to andersk/zulip that referenced this pull request Apr 22, 2020
Generated by autopep8, with the setup.cfg configuration from zulip#14532.
I’m not sure why pycodestyle didn’t already flag these.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
andersk added a commit to andersk/zulip that referenced this pull request Apr 22, 2020
Generated by autopep8 --aggressive, with the setup.cfg configuration
from zulip#14532.  In general, an isinstance check may not be equivalent to
a type check because it includes subtypes; however, that’s usually
what you want.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
andersk added a commit that referenced this pull request Apr 22, 2020
Generated by autopep8, with the setup.cfg configuration from #14532.
I’m not sure why pycodestyle didn’t already flag these.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
andersk added a commit that referenced this pull request Apr 22, 2020
Generated by autopep8 --aggressive, with the setup.cfg configuration
from #14532.  In general, an isinstance check may not be equivalent to
a type check because it includes subtypes; however, that’s usually
what you want.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
briansmith337 pushed a commit to briansmith337/zulip that referenced this pull request May 6, 2020
Generated by autopep8, with the setup.cfg configuration from zulip#14532.
I’m not sure why pycodestyle didn’t already flag these.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
briansmith337 pushed a commit to briansmith337/zulip that referenced this pull request May 6, 2020
Generated by autopep8 --aggressive, with the setup.cfg configuration
from zulip#14532.  In general, an isinstance check may not be equivalent to
a type check because it includes subtypes; however, that’s usually
what you want.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
Dakkaron pushed a commit to Dakkaron/zulip that referenced this pull request May 12, 2020
Generated by autopep8, with the setup.cfg configuration from zulip#14532.
I’m not sure why pycodestyle didn’t already flag these.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
Dakkaron pushed a commit to Dakkaron/zulip that referenced this pull request May 12, 2020
Generated by autopep8 --aggressive, with the setup.cfg configuration
from zulip#14532.  In general, an isinstance check may not be equivalent to
a type check because it includes subtypes; however, that’s usually
what you want.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
@andersk andersk force-pushed the flake8 branch 2 times, most recently from c7ce0cb to 68fbb27 Compare June 15, 2020 21:31
@zulip zulip deleted a comment from zulipbot Jul 4, 2020
Signed-off-by: Anders Kaseorg <anders@zulip.com>
Flake8 automatically gives us support for noqa comments, parallelism,
configuration files, plugins, and easy editor integration.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
@andersk
Copy link
Member Author

andersk commented Feb 13, 2021

Upstream performance issues:

The latter is especially relevant now that we disable most pycodestyle checks in favor of Black (#15662).

@zulipbot
Copy link
Member

zulipbot commented Sep 8, 2021

Heads up @andersk, we just merged some commits that conflict with the changes your made in this pull request! You can review this repository's recent commits to see where the conflicts occur. Please rebase your feature branch against the upstream/main branch and resolve your pull request's merge conflicts accordingly.

@timabbott
Copy link
Sponsor Member

Closing as these linters are obsolete thanks to ruff.

@timabbott timabbott closed this Oct 1, 2023
@andersk andersk deleted the flake8 branch October 16, 2023 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants