Commit Graph
10 Commits
Author SHA1 Message Date
mkarolin 8b27963983 Pylint fixes. 2021-12-07 14:46:01 -05:00
mkarolin 36015fdb28 Updated check_chromium_src.py script.
- Added BUILD.gn files to exclusions
- Added *test.mm files to exclusions
- Alphabetized exclusions
2021-12-07 14:45:59 -05:00
Mihai PLESA 49874507d1 fixed line lengths to 80 and do autopep8 2021-10-29 17:54:41 -05:00
Mario Sanchez Prada 089e7fdf3c Support function-like definitions in check_chromium_src.py
This adds support for function-like definitions in this script, at the
same time that fixes support for normal definitions done over multiple
lines, which was not working as intented with the previous regexp.

Resolves https://github.com/brave/brave-browser/issues/17937
2021-09-08 17:27:30 +02:00
mkarolin 93f49aebeb Modified check_chromium_src.py with the latest in/exclusions. 2021-05-05 12:24:50 +02:00
Mario Sanchez Prada 5c7b656061 Make EXCLUDES regexp list work on non-UNIX-like shells (e.g. Windows)
To make this work well on shells like Windows' cmd.exe or PowerShell,
we add an intermediate step before matching the paths for files found
in the repository against the regular expresisons declared in EXCLUDES,
so that we use forward slashes instead of backward slashes, which will
cause errors due to the regexp interpreting paths like C:\\mypath as if
they contained the escaped '\m' character.

Once the regular expression has been used though, we still append the
unnormalized OS-dependant relative path to the list of paths built by
filter_chromium_src_filepaths(), so that further operations over those
files can be performed correctly, and so that any path printed in the
output will use the OS-dependant path separator.
2021-03-10 10:41:58 +01:00
Mario Sanchez Prada 90458f6e77 Avoid Unicode decoding-related errors by opening files as utf-8
Otherwise some errors might happen on Windows when reading through
the files' contents searching for matches against regexp patterns.
2021-03-02 17:19:24 +01:00
Mario Sanchez Prada 91607f7b23 Rename global variables to something more consistent and less confusing
To make it clearer where each global variable points to, rename:
  * SOURCE_ROOT -> BRAVE_SRC
  * CHROMIUM_SRC -> BRAVE_CHROMIUM_SRC
  * SRC_DIR -> CHROMIUM_SRC
2021-03-02 17:09:34 +01:00
Mario Sanchez Prada e63bf0aad3 Fix problems with relative paths on Windows
We can't use the OS path separator when handling C++ include paths but
UNIX-like path separators instead, otherwise counting the number of
'../' components wont' work, nor creating the list of relative paths
to chromium_src override files to be checked.
2021-03-02 17:06:01 +01:00
Mario Sanchez Prada 867f9726ce Rewrite the check_chromium_src.sh bash script in python
We would like to expand the functionality of this script to allow us
to check for more potentially problematic situations (e.g. new uses
of re-defined symbols inside a given overriden file), so let's migrate
it to Python first so that's easier to extend.

Resolves https://github.com/brave/brave-browser/issues/14382
2021-02-26 17:26:15 +01:00