Skip to content

Whisperity refactor/script/label generator tooling#4439

Merged
dkrupp merged 8 commits into
masterfrom
whisperity-refactor/script/label-generator-tooling
Jan 28, 2025
Merged

Whisperity refactor/script/label generator tooling#4439
dkrupp merged 8 commits into
masterfrom
whisperity-refactor/script/label-generator-tooling

Conversation

@dkrupp
Copy link
Copy Markdown
Member

@dkrupp dkrupp commented Jan 27, 2025

Merge PR created from #4225 as Github was not able to merge.

whisperity and others added 8 commits July 9, 2024 19:02
Automatically generate the `doc_url` labels for checkers for analysers
which we know how to do this.
(Currently implemented only for Clang SA and Clang-Tidy.)
This tooling does a single HTTP request to download a "Table of
Contents" (ToC) document and uses HTML DOM scraping to extract the list
of checkers and their corresponding documentation link.

There was existing prior work for this feature, but those scripts were
about 3 years old (introduced in 2021. Nov, commit
aa72dc0), and they ceased to properly
work.
For example, for _Clang-Tidy_, the contents of the ToC changed in a
way that the previously used XPath expression did not match anything
at all.
In addition, the previous work at `doc_url.py` (later renamed
`doc_url_generate.py`) only generated labels for the checkers that were
_already_ present in the configuration file, defeating the purpose of
using a script to determine new labels for checkers.

This version reintroduces an improved DOM scraping logic, and enables
generating `doc_url` for checkers that are not yet present in the
configuration file, all the while using the new `label_tool/` package
structure introduced in a previous commit.
Automatically generate the `severity` labels for checkers of analysers
which we know how to.
(Currently implemented only for the Clang diagnostic (warning) flags
exposed through Clang-Tidy.)

There was existing prior work for this feature, but that script was
about 3 years old (introduced in 2021. Nov, commit
8d1a7fe), and due to changes in the
DOM of Sphinx documents, ceased to work properly since.

This refactoring is smaller in scope than the `doc_url` generation that
was done in a previous commit, as the original `compiler_warnings.py`
script accurately generated severities (and `doc_url`s, for that matter)
for previously "unknown" "checkers" as well.
Considering that all previously developed label-generating tools are now
subsumed into the new `label_tool` package, the extra directory is unnecessary.
After upgrade on `master` to `pylint==3.2.4`, new warnings are enabled
which were not honoured in `label-tool`.
Copy link
Copy Markdown
Contributor

@vodorok vodorok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@dkrupp dkrupp merged commit 1d81ff6 into master Jan 28, 2025
@bruntib bruntib deleted the whisperity-refactor/script/label-generator-tooling branch January 30, 2026 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants