Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow local mirror of https://clang.llvm.org/extra/clang-tidy/checks/list.html #19

Open
JoevDubach opened this issue Jan 5, 2023 · 0 comments

Comments

@JoevDubach
Copy link

I don't have a full implementation - this is just a idea for how clang_html could allow a safety valve for recurring SSL issues like #17 , as well as hypothetical use cases where the build machine is disconnected from the internet.

I was able to fetch an apparently sufficient subset of the website via:
wget -r -N -l 1 -k https://clang.llvm.org/extra/clang-tidy/checks/list.html
...then kept only the resulting "clang.llvm.org/extra/clang-tidy/checks" directory, which amounted to 3.5M of data.

clang_html could be changed to require requests-file:
https://github.com/dashea/requests-file

Then find_checks_dict could be changed to allow a requests-file transport in addition to its existing TLSAdapter:

from requests_file import FileAdapter

def find_checks_dict(checks_dict_url: str):
    session = Session()
    session.mount('https://', TLSAdapter())
    session.mount('file://', FileAdapter())
    res = session.get(checks_dict_url)

...then I could use --checks_dict_url with a "file://" version of a local filename, or clang_html could provide a new command line option --checks_dict_file specifying a local filename that it could transform into a "file://" link with the pathlib as_uri feature, present in all versions of Python supported by clang_html:

Python 3.9.1 (tags/v3.9.1:1e5d33e, Dec  7 2020, 17:08:21) [MSC v.1927 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import pathlib
>>> pathlib.Path("D:\\work\\checks\\list.html").as_uri()
'file:///D:/work/checks/list.html'
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

No branches or pull requests

1 participant