Closed xmo-odoo closed 7 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?
@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)
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
@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.
Can we minize the change in runbot ? Minimum number of diff in runbot,py ? Orthogonal status for lint only in the pylint module.
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?
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)
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:
running it multiple times on the same branch will result in repeated messages, getting existing comments and updating/replacing/replying to them might be a good idea?all linting messages are currently hard errors (failures), that shouldn't be a huge issue as they're relatively conservative and they can be disabled using pylint annotations (#pylint: disable=w1, w2
). Still if we start adding custom lints maybe there should be a way for lints to be configured as "mark for extra review", and be reviewable? Not sure how.hardcoded a special case__openerp__.py
will systematically trigger "statement seems to have no effect", not sure how to ignore only this specific lint on this specific file aside from special-casing it in the already overriddenis_message_enabled
. We may want to add manifest lints in the future so disabling it entirely may not be such a good ideaprint
andassert
(windows builds use "optimised" bytecode so asserts are stripped).set_trace()
?)check forrequires significant control flow analysis which Pylint doesn't seem to provide fordict(context, key=v)
wherecontext
may still beNone
. (odoo/odoo#10679)dict.update(literal_dict)
review-comments currently generate one email alert each (from github) (may be due to not reusing sessions)changed to set runbot status to warn, log the issues to the runbot's log and not post messages to the PR itself anymore. Still sets a failure ci/lint status on the PR./cc @odony @mart-e @rco-odoo @antonylesuisse @dbo-odoo