Commit graph

6 commits

Author SHA1 Message Date
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
Mirko Bonadei
8cc6695652 Reformat python files checked by pylint (part 1/2).
After recently changing .pylintrc (see [1]) we discovered that
the presubmit check always checks all the python files when just
one python file gets updated.

This CL moves all these files one step closer to what the linter
wants.

Autogenerated with:

# Added all the files under pylint control to ~/Desktop/to-reformat
cat ~/Desktop/to-reformat | xargs sed -i '1i\\'
git cl format --python --full

This is part 1 out of 2. The second part will fix function names and
will not be automated.

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

No-Presubmit: True
Bug: webrtc:12114
Change-Id: Idfec4d759f209a2090440d0af2413a1ddc01b841
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/190980
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32530}
2020-10-30 10:13:11 +00:00
Mirko Bonadei
b7dc45f8e8 Update check_package_boundaries.
Before reformatting GN files (see [1] for why this is needed), the
presubmit check to ensure targets are not violating package boundaries
needs to be fixed because its regular expressions don't always work with
the new format.

This CL removes the parsing of line numbers to relax the regular
expressions without losing any functionality.

Error before this CL:
***************
<PATH>/webrtc/src/BUILD.gn:674 in target 'android_junit_tests':
  Source file 'examples/androidjunit/src/org/appspot/apprtc/BluetoothManagerTest.java'
  crosses boundary of package 'examples'.

<PATH>/webrtc/src/BUILD.gn:675 in target 'android_junit_tests':
  Source file 'examples/androidjunit/src/org/appspot/apprtc/DirectRTCClientTest.java'
  crosses boundary of package 'examples'.

<PATH>/webrtc/src/BUILD.gn:676 in target 'android_junit_tests':
  Source file 'examples/androidjunit/src/org/appspot/apprtc/TCPChannelClientTest.java'
  crosses boundary of package 'examples'.

<PATH>/webrtc/src/BUILD.gn:677 in target 'android_junit_tests':
  Source file 'sdk/android/tests/src/org/webrtc/AndroidVideoDecoderTest.java'
  crosses boundary of package 'sdk'.

<PATH>/webrtc/src/BUILD.gn:678 in target 'android_junit_tests':
  Source file 'sdk/android/tests/src/org/webrtc/CameraEnumerationTest.java'
  crosses boundary of package 'sdk'.
***************


Error after this CL:
***************
<PATH>/webrtc/src/BUILD.gn in target 'android_junit_tests':
  Source file 'examples/androidjunit/src/org/appspot/apprtc/BluetoothManagerTest.java'
  crosses boundary of package 'examples'.

<PATH>/webrtc/src/BUILD.gn in target 'android_junit_tests':
  Source file 'examples/androidjunit/src/org/appspot/apprtc/DirectRTCClientTest.java'
  crosses boundary of package 'examples'.

<PATH>/webrtc/src/BUILD.gn in target 'android_junit_tests':
  Source file 'examples/androidjunit/src/org/appspot/apprtc/TCPChannelClientTest.java'
  crosses boundary of package 'examples'.

<PATH>/webrtc/src/BUILD.gn in target 'android_junit_tests':
  Source file 'sdk/android/tests/src/org/webrtc/AndroidVideoDecoderTest.java'
  crosses boundary of package 'sdk'.

<PATH>/webrtc/src/BUILD.gn in target 'android_junit_tests':
  Source file 'sdk/android/tests/src/org/webrtc/CameraEnumerationTest.java'
  crosses boundary of package 'sdk'.
***************


[1] - https://gn-review.googlesource.com/c/gn/+/6860

Bug: webrtc:11302
Change-Id: Ia39387d089a0c56a2c3ad9a7264c20eb5a38ac93
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/166535
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30331}
2020-01-21 11:06:40 +00:00
Oleh Prypin
2f33a5671e Simplify PRESUBMIT.py and check_package_boundaries.py
Bug: webrtc:6954
Change-Id: Ia93eb8cc8a13bdcba5217fd8d52b72defa108b2f
Reviewed-on: https://webrtc-review.googlesource.com/6021
Commit-Queue: Oleh Prypin <oprypin@webrtc.org>
Reviewed-by: Henrik Kjellander <kjellander@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20158}
2017-10-05 09:24:30 +00:00
Oleh Prypin
afe016501e Fix bugs in check_package_boundaries.py presubmit
It was not producing any results on presubmit for 2 reasons:
- The list of modified GN files contained relative paths but the list
  of all GN files contains absolute paths.
- The root directory was not passed to the script and the path of the
  first file substituted it.

Fix potential problem with using unescaped names in a regex.

Blacklist testdata directory with intentionally bad BUILD.gn files.

NOTRY=True

Bug: webrtc:6954
Change-Id: Ib0b845b9440b594960bc8a656e8a84d2ccb4a684
Reviewed-on: https://webrtc-review.googlesource.com/5981
Reviewed-by: Edward Lemur <ehmaldonado@webrtc.org>
Reviewed-by: Henrik Kjellander <kjellander@webrtc.org>
Commit-Queue: Oleh Prypin <oprypin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20149}
2017-10-04 18:11:24 +00:00
mbonadei
ab587dc9a4 Moving check_package_boundaries to the presubmit checks directory
Since we now have a directory for this kind of checks, let's move this
to that location.

BUG=None
NOTRY=True

Review-Url: https://codereview.webrtc.org/2870393006
Cr-Commit-Position: refs/heads/master@{#18122}
2017-05-12 11:13:31 +00:00
Renamed from tools_webrtc/check_package_boundaries.py (Browse further)