Commit graph

10 commits

Author SHA1 Message Date
Emil Lundmark
7892f05411 Configure Pylint to follow PEP-8
This is a follow-up on [1] to make presubmit succeed on PEP-8 compliant
code.

[1] https://webrtc-review.googlesource.com/c/src/+/321122

Bug: None
Change-Id: Ie4261cf6c15f22c152a7d5793d7b1f7a71109f33
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/321081
Reviewed-by: Jeremy Leconte <jleconte@webrtc.org>
Commit-Queue: Emil Lundmark <lndmrk@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40803}
2023-09-25 15:56:09 +00:00
Christoffer Jansson
4e8a773b4b tools_webrtc dir converted to py3 + top level PRESUBMIT script
Bug: webrtc:13607
Change-Id: Ib018e43ea977cc24dd71048e68e3343741f7f31b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/249083
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Jeremy Leconte <jleconte@google.com>
Commit-Queue: Christoffer Jansson <jansson@google.com>
Cr-Commit-Position: refs/heads/main@{#35953}
2022-02-08 14:42:26 +00:00
Jeremy Leconte
f22c78b01a Fix mb.py presubmit issues.
* Add a config file for python formatting (.style.yapf).
* Change the default indentation from 4 spaces to 2 spaces.
* Run 'git cl format --python' on a few python files.

Bug: webrtc:13413
Change-Id: Ia71135131276c2c499b00032d57ad16ee5200a5c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/238982
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Christoffer Jansson <jansson@google.com>
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Commit-Queue: Jeremy Leconte <jleconte@google.com>
Cr-Commit-Position: refs/heads/main@{#35500}
2021-12-08 08:53:00 +00:00
Mirko Bonadei
9012b09ea7 Undo enforcing of PEP-8 pylint changes for method and function names.
The full reformat will take some time, let's postpone function and
method names.

Bug: webrtc:12114
Change-Id: I2b8f19fb257af20a254c28d34cee62a1a574bcd8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/192380
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32576}
2020-11-10 18:26:25 +00:00
Mirko Bonadei
d9603b276b Update pylintrc to match Chromium style guide.
According to [1], the Chromium Python Style Guide has changed and it
is not requiring any custom change compared to PEP-8.

This CL removes the exceptions from pylintrc.

[1] - https://chromium.googlesource.com/chromium/src/+/master/styleguide/python/python.md#our-previous-python-style

Bug: None
Change-Id: I2c8c8ab20536a4bea094dfa658c9c8391ea30251
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186664
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32339}
2020-10-07 10:55:06 +00:00
Artem Titov
5d7a4c6692 Fixing py lint errors
Bug: webrtc:9548
Change-Id: I0daf8dc06fdaac1637c32994ef6ad542ed52202a
Reviewed-on: https://webrtc-review.googlesource.com/90045
Reviewed-by: Oleh Prypin <oprypin@webrtc.org>
Reviewed-by: Niklas Enbom <niklas.enbom@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24068}
2018-07-23 15:28:48 +00:00
Mirko Bonadei
3152afd361 Removing invalid-name from disabled pylint checks.
It has been introduced in https://webrtc-review.googlesource.com/c/src/+/1566 but now it seems we can remove it since it is not raising any failure.

NOTRY=True

Bug: None
Change-Id: Id82b1b7fba6b5277753eabbf9fb7a722819532f9
Reviewed-on: https://webrtc-review.googlesource.com/8302
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Henrik Kjellander <kjellander@google.com>
Reviewed-by: Henrik Kjellander <kjellander@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20235}
2017-10-11 08:06:49 +00:00
Henrik Kjellander
a18a3bf8d6 Fix Python shebang and license for presubmit_test.py
This was missed during review of https://codereview.webrtc.org/3010153002
Having python2 in the shebang makes it fail presubmit locally on Mac.

Disable 'invalid-name' PyLint rule in 3 places to pass presubmit.

NOTRY=True
NOTREECHECKS=True
TBR=charujain@webrtc.org

Bug: none
Change-Id: I85cc5783ba11774792cd8c2f6c0b4ff47ad89270
Reviewed-on: https://webrtc-review.googlesource.com/1566
Commit-Queue: Henrik Kjellander <kjellander@webrtc.org>
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Reviewed-by: Henrik Kjellander <kjellander@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#19850}
2017-09-15 09:22:50 +00:00
kjellander
38c65c8fb4 Update pylintrc to catch more style violations.
The current PyLint configuration doesn't catch violations
to the Chromium Python Style Guide in a good way.

This change adds mostly the correct style regex for functions
and methods, with most content copied from
https://cs.chromium.org/chromium/tools/depot_tools/pylintrc
and (since the former disables invalid-name)
https://cs.chromium.org/chromium/src/third_party/chromite/pylintrc

Many settings are the defaults, but are now more explicit to make it
easier to find them for our users.

Also convert the previous one-line list of disabled lint check into
a one-per-line list instead.

Add import-error to the list of disabled lint checks.

This CL depends on https://codereview.webrtc.org/2812273002/
to be landed first in order to not produce a lot of errors.

BUG=webrtc:7303
NOTRY=True
TESTED=git cl presubmit passing when tested in
combination with https://codereview.webrtc.org/2812273002/
TBR=niklas.enbom@webrtc.org

Review-Url: https://codereview.webrtc.org/2737963003
Cr-Commit-Position: refs/heads/master@{#17685}
2017-04-13 05:43:38 +00:00
Henrik Kjellander
57e5fd2e60 PRESUBMIT: Improve PyLint check and add GN format check.
Add pylintrc file based on
https://code.google.com/p/chromium/codesearch#chromium/src/tools/perf/pylintrc
bit tightened up quite a bit (the one in depot_tools is far
more relaxed).

Remove a few excluded directories from pylint check and fixed/
suppressed all warnings generated.

Add GN format check + formatted all GN files using 'gn format'.
Cleanup redundant rules in tools/PRESUBMIT.py

TESTED=Ran 'git cl presubmit -vv', fixed the PyLint violations.
Ran it again with a modification in webrtc/build/webrtc.gni, formatted
all the GN files and ran it again.

R=henrika@webrtc.org, phoglund@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/50069004

Cr-Commit-Position: refs/heads/master@{#9274}
2015-05-25 10:55:50 +00:00