odoo / odoo-extra

unsupported addons (runbot, document_fs)
117 stars 245 forks source link

PyLint integration to runbot #94

Closed xmo-odoo closed 7 years ago

xmo-odoo commented 8 years ago

Runs pylint embedded, filters lint messages to only keep those applying to lines touched by the pull request and, the messages as inline comments on the github PR and sets a cl/lint status, as visible on odoo/odoo#10374. @tivisse can confirm that it's super extra awesome.

Currently adds dependencies on pylint for the linting itself and edx-lint for a few interesting lints by @nedbat (which we used with @mart-e to find and fix non-static strings used in translation functions). Works on both "primary" repository (odoo/odoo) and "modules" repositories (with all modules at the repository root).

Advantages:

This is a working technical basis, but not exactly done:

/cc @odony @mart-e @rco-odoo @antonylesuisse @dbo-odoo

odony commented 8 years ago

For the record, the OCA also has https://github.com/OCA/runbot-addons/tree/9.0/runbot_pylint - do you know how this one differs?

xmo-odoo commented 8 years ago

@odony I hadn't seen it, so I have no idea how they differ. Quickly going over the readme (so I may well be wrong and miss things)

tivisse commented 8 years ago

I cannot wait to see the Github Integration into mail. So that I can see all these wonderful messages in the chatter. @mart-e #puke

xmo-odoo commented 8 years ago

@odony @antonylesuisse @rco-odoo barring the necessity of additional custom lints (sadly the detection of methods using None context didn't really work out, no way to easily do the CFA) I think it's in a pretty good shape, at least for an initial deployment.

antonylesuisse commented 8 years ago

Can we minize the change in runbot ? Minimum number of diff in runbot,py ? Orthogonal status for lint only in the pylint module.

xmo-odoo commented 8 years ago

Can we minize the change in runbot ? Minimum number of diff in runbot,py ?

If a bunch of stuff being duplicated in the pylint extension doesn't matter then sure I can revert pretty much all the changes in runbot (and move that stuff to just runbot_pylint)

Orthogonal status for lint only in the pylint module.

As in, add a second status field to builds then go and "extend" (copy/paste a bunch of) the HTML views to include that new status in the display?

xmo-odoo commented 8 years ago

Modified reporting to add an icon to PR branches for indication of linting result, and reverted changes to per-build state (since the linting is done at a commit, but it's really done on the revision range involved in a PR, it's not done on a specific commit)