Python flake8 linter task live on treeherder

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Python flake8 linter task live on treeherder

Andrew Halberstadt
A flake8 [1] linter was landed to central a couple weeks ago, and now
there is a corresponding taskcluster task that uses it. It only lints
directories that are explicitly whitelisted. To start, these are:

* python/mozlint
* tools/lint

Anyone who wants to add their own directories can do so by adding the
path to the 'include' directive at the bottom of:
tools/lint/flake8.lint

Of course, be sure there are no lint errors in this directory before
landing this change! You can run the linter locally with:
../mach lint -l flake8 <path>

The global flake8 configuration lives in topsrcdir/.flake8, but you can
override this global per subdirectory by adding a new .flake8 file in
that subdirectory. See [2] for configuration docs. We should definitely
bikeshed over which pep8 rules we wish to enforce/warn/ignore globally.
If you have strong feelings on any of them, please file a new thread for
that topic on mozilla.tools.

Finally, this task is using a new system called mozlint [3]. The aim of
mozlint is to standardize how we implement, run and report linters to
avoid re-inventing the wheel every time a new linter comes along. I'll
be switching the existing eslint implementation over to this as well. If
you have a linter you'd like to stand up locally or in automation,
please talk to me and I'll help point you in the right direction.

Let me know if you have any questions or spot any bugs!
Cheers,
Andrew

[1] https://gecko.readthedocs.io/en/latest/tools/lint/linter/flake8.html
[2] https://flake8.readthedocs.io/en/latest/config.html
[3] https://gecko.readthedocs.io/en/latest/tools/lint/index.html
_______________________________________________
dev-builds mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-builds
Reply | Threaded
Open this post in threaded view
|

Re: Python flake8 linter task live on treeherder

William Lachance-2
On 2016-06-01 8:03 PM, Andrew Halberstadt wrote:
> A flake8 [1] linter was landed to central a couple weeks ago, and now
> there is a corresponding taskcluster task that uses it. It only lints
> directories that are explicitly whitelisted. To start, these are:

So this sounds pretty neat, a few months ago :parkouss added support for
talos that does something very similar. I filed a bug to check talos
with this new feature instead:

https://bugzilla.mozilla.org/show_bug.cgi?id=1278257

This does bring up the obvious question: how do we notice in treeherder
if our patches break compliance? Will our try runs fail? Will sheriffs
back people out for violations?

Will
_______________________________________________
dev-builds mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-builds
Reply | Threaded
Open this post in threaded view
|

Re: Python flake8 linter task live on treeherder

Andrew Halberstadt
On 06/06/16 10:40 AM, William Lachance wrote:
> This does bring up the obvious question: how do we notice in treeherder
> if our patches break compliance? Will our try runs fail? Will sheriffs
> back people out for violations?

Yeah, your try runs will fail and sheriffs will back people out.
Currently the job is Tier-2, so sheriffs should notify whoever broke the
job and give them a chance to fix it without backing out (and resorting
to backouts only if the author isn't around to fix).

You can also run |mach lint testing/talos| locally, and even set up a
pre-push hook in your hgrc if you want. Maybe we should look into an
"official" pre-push hook that can optionally be set up by mercurial-setup.

Andrew
_______________________________________________
dev-builds mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-builds
Reply | Threaded
Open this post in threaded view
|

Re: Python flake8 linter task live on treeherder

Sylvestre Ledru
In reply to this post by Andrew Halberstadt
Hello,



Le 02/06/2016 à 02:03, Andrew Halberstadt a écrit :
> A flake8 [1] linter was landed to central a couple weeks ago, and now
> there is a corresponding taskcluster task that uses it. It only lints
> directories that are explicitly whitelisted. T
This is great! Many thanks for doing it!

In the past, I used flake8 changes as source of good first bug:
https://bugzilla.mozilla.org/show_bug.cgi?id=1155970
We could report a bunch to enable flake8 on other directories.

Sylvestres

_______________________________________________
dev-builds mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-builds