- Problem() is a parent abstract class that should only be used for
subclassing.
- With the help of ABC, implement abstract methods that force
subclasses to implement quiet and verbose outputs.
- The repeated logic of "if self.quiet" is consolidated in Problem.
Signed-off-by: Yuto Takano <yuto.takano@arm.com>
This reverts a previous change where line_no was removed and put into
a triple tuple. It was discovered that re.Match.span() conveniently
returns (start, end), so separating line_no again makes the code cleaner.
The legibility of the code heavily outweighs the issues pointed out by
Pylint (hence disabled).
Signed-off-by: Yuto Takano <yuto.takano@arm.com>
The try/catch was used to catch Exceptions and exit with code 1,
a legacy from check_names.py which uses the pattern to exit with
code 2. But code 1 is the default for the Python runtime anyway,
so it is redundant and can be removed.
Signed-off-by: Yuto Takano <yuto.takano@arm.com>
- Instead of os.path.join, use glob patterns (supports Windows too)
- Instead of creating the lists beforehand (which adds messiness), pass glob
expessions to functions and let them memoise it.
- Add support for excluding based on glob patterns, which isn't used now but
could come in handy.
Signed-off-by: Yuto Takano <yuto.takano@arm.com>
This is the equivalent of `list-identifiers.sh --internal`, which is
useful for generating an exclusion file for ABI/API checking.
Signed-off-by: Yuto Takano <yuto.takano@arm.com>
glob is more flexible and simplifies the function arguments drastically.
It is also much more intuitive to extend in the future when the filepaths
need to be extended or changed.
setup_logger had to be called as the first thing after instantiation, so
this commit simplify makes it automatic.
Several clarification comments are added too.
Signed-off-by: Yuto Takano <yuto.takano@arm.com>
This is necessary to import check_names from other scripts, which
will inevitably happen in the next few commits to implement the equivalent
of `list-identifiers.sh --internal`.
Signed-off-by: Yuto Takano <yuto.takano@arm.com>
- Add documentation to all classes and functions that were
not self-explanatory.
- Fix the parsing of identifiers, so it now behaves identically
to the original shell script. Detects the same amount of identifiers.
- Fix macro parsing so MBEDTLS_PSA_ACCEL didn't error out
- Reformat output to be comprehensible
Signed-off-by: Yuto Takano <yuto.takano@arm.com>