-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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: bring back sentry.lint.sentry_check:SentryCheck #9053
Conversation
So after being extremely mad at computers, this really is the only sensible way to do it now. There's not a way to programmatically register extensions/plugins without digging really deep into things that flake8 does not want you to dig deep into and would be too much of a hack. but this also means that this snippet of config needs to exist in all repos that try to use our checks since it won't inherit from the sentry repo in my testing. And lastly, now that it's actually running our checks, it points out linter violations that you introduced in a commit while linters weren't running. So fix that up. :) |
Scanning all the repos I have, the only one that seems to actually do this ouside of this one are: getsentry/getsentry and getsentry/sentry-plugins |
@mattrobenolt so flake8 doesn't yet support file-level error ignores. It's currently possible with an additional plugin, but we probably don't want more stuff. I'd have to inline |
6aa983a
to
41e41a7
Compare
Right. Just don’t use print. You can use like, def echo(s, err=False):
fp = sys.stderr if err else sys.stdout
fp.write(s)
fp.flush() |
Note: we discussed this briefly outside of the issue and we're just going to noqa the print lines. |
So the currently pinned pycodestyle 2.3.0 in #9000 is kind of buggy. For example:
Bumping to 2.3.1 fixes this, but the latest 2.4.0 does not work with flake8 3.5.0. |
Upgrading to flake8 3.5.0 caused
pycodestyle
'sregister_check
to silently ignore our custom checker, so we're missing out on some linting. Fortunately, flake8 3.5.0 lets us use local plugins viasetup.cfg
as documented here.