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

Ignore a warning for a specific URL only #782

Closed
nodet opened this issue Dec 21, 2023 · 2 comments
Closed

Ignore a warning for a specific URL only #782

nodet opened this issue Dec 21, 2023 · 2 comments

Comments

@nodet
Copy link
Contributor

nodet commented Dec 21, 2023

Summary

I have documents to check that purposefully have links that are redirected. I'd like to ignore the http-redirected warning on these URLs, but I don't want to ignore this warning for all other URLs in the document.

ignorewarnings in the documentation for linkcheckerrc would apply to all URLs in my document, and would prevent me from detecting redirects on other URLs.

Did I miss something?

Steps to reproduce

Here's a URL that reproduces the 'redirect', and that I would want to ignore:

$ linkchecker https://www.gurobi.com/release-notes/server/v11.0/

Environment

  • Operating system: Darwin my-macbookpro-2022.local 22.6.0 Darwin Kernel Version 22.6.0: Tue Nov 7 21:40:08 PST 2023; root:xnu-8796.141.3.702.9~2/RELEASE_ARM64_T6000 arm64
  • Linkchecker version: 10.4.0
  • Python version: 3.11.6
  • Install method: pip install linkchecker

Configuration

$ linkchecker linkchecker -Dcmdline -q
DEBUG linkcheck.cmdline 2023-12-21 19:46:59,885 MainThread Python 3.11.6 (main, Oct 12 2023, 14:23:47) [Clang 15.0.0 (clang-1500.0.40.1)] on darwin
INFO linkcheck.cmdline 2023-12-21 19:46:59,891 MainThread Checking intern URLs only; use --check-extern to check extern URLs.
DEBUG linkcheck.cmdline 2023-12-21 19:46:59,891 MainThread configuration: [('aborttimeout', 300),
 ('allowedschemes', []),
 ('authentication', []),
 ('checkextern', False),
 ('cookiefile', None),
 ('csv', {}),
 ('debugmemory', False),
 ('dot', {}),
 ('enabledplugins', []),
 ('externlinks', []),
 ('failures', {}),
 ('fileoutput', []),
 ('gml', {}),
 ('gxml', {}),
 ('html', {}),
 ('ignoreerrors', []),
 ('ignorewarnings', []),
 ('internlinks', []),
 ('localwebroot', None),
 ('logger', 'NoneLogger'),
 ('loginextrafields', {}),
 ('loginpasswordfield', 'password'),
 ('loginurl', None),
 ('loginuserfield', 'login'),
 ('maxfilesizedownload', 5242880),
 ('maxfilesizeparse', 1048576),
 ('maxhttpredirects', 10),
 ('maxnumurls', None),
 ('maxrequestspersecond', 10),
 ('maxrunseconds', None),
 ('none', {}),
 ('output', 'text'),
 ('pluginfolders', []),
 ('quiet', False),
 ('recursionlevel', -1),
 ('resultcachesize', 100000),
 ('robotstxt', True),
 ('sitemap', {}),
 ('sql', {}),
 ('sslverify',
  '/Users/xavier.nodet/Documents/work/docs-411/venv/lib/python3.11/site-packages/certifi/cacert.pem'),
 ('status', True),
 ('status_wait_seconds', 5),
 ('text', {}),
 ('threads', 10),
 ('timeout', 60),
 ('trace', False),
 ('useragent',
  'Mozilla/5.0 (compatible; LinkChecker/10.4.0; '
  '+https://linkchecker.github.io/linkchecker/)'),
 ('verbose', False),
 ('warnings', True),
 ('xml', {})]
nodet added a commit to nodet/linkchecker that referenced this issue Jan 6, 2024
We want to allow specifying a warning to ignore for
each URL. If no regex is specified for the warning to ignore,
we'll ignore all warnings.

The tests still pass as they are, which means that unknown
values in the configuration file are simply ignored.
nodet added a commit to nodet/linkchecker that referenced this issue Jan 6, 2024
nodet added a commit to nodet/linkchecker that referenced this issue Jan 6, 2024
nodet added a commit to nodet/linkchecker that referenced this issue Jan 6, 2024
nodet added a commit to nodet/linkchecker that referenced this issue Jan 6, 2024
nodet added a commit to nodet/linkchecker that referenced this issue Jan 6, 2024
@nodet
Copy link
Contributor Author

nodet commented Jan 6, 2024

Remaining work, as far as I can see:

  • When no warning regex is specified, all warnings should be ignored
  • Allow ignoring warnings from the command line -- Won't do (c.f. Allow FIFOs to be used as config files #767)
  • Documentation
  • Should it be possible to use '302' instead of 'http-redirected'? (answer is no)

nodet added a commit to nodet/linkchecker that referenced this issue Jan 6, 2024
nodet added a commit to nodet/linkchecker that referenced this issue Jan 6, 2024
nodet added a commit to nodet/linkchecker that referenced this issue Jan 6, 2024
nodet added a commit to nodet/linkchecker that referenced this issue Jan 6, 2024
nodet added a commit to nodet/linkchecker that referenced this issue Feb 3, 2024
nodet added a commit to nodet/linkchecker that referenced this issue Feb 3, 2024
nodet added a commit to nodet/linkchecker that referenced this issue Feb 3, 2024
nodet added a commit to nodet/linkchecker that referenced this issue Feb 3, 2024
nodet added a commit to nodet/linkchecker that referenced this issue Feb 3, 2024
nodet added a commit to nodet/linkchecker that referenced this issue Feb 3, 2024
nodet added a commit to nodet/linkchecker that referenced this issue Feb 3, 2024
nodet added a commit to nodet/linkchecker that referenced this issue Feb 3, 2024
nodet added a commit to nodet/linkchecker that referenced this issue Feb 3, 2024
nodet added a commit to nodet/linkchecker that referenced this issue Feb 11, 2024
nodet added a commit to nodet/linkchecker that referenced this issue Feb 11, 2024
nodet added a commit to nodet/linkchecker that referenced this issue Feb 11, 2024
nodet added a commit to nodet/linkchecker that referenced this issue Feb 11, 2024
nodet added a commit to nodet/linkchecker that referenced this issue Feb 11, 2024
nodet added a commit to nodet/linkchecker that referenced this issue Feb 11, 2024
cjmayo pushed a commit that referenced this issue Feb 13, 2024
We want to allow specifying a warning to ignore for
each URL. If no regex is specified for the warning to ignore,
we'll ignore all warnings.

The tests still pass as they are, which means that unknown
values in the configuration file are simply ignored.

* [#782] Add values to configuration file

* [#782] Parse new configuration values

* [#782] Actually ignore a warning

* [#782] Confirm side cases work as expected

* [#782] Add logging when deciding to ignore warnings

* [#782] Documentation for ignorewarningsforurls

* [#782] Update (generated) man pages

* [#782] These tests pass without network, actually

* [#782] Fix copy/paste error in symbol naming

* [#782] The regex matches the name of the warning, not the message

* [#782] Better wording

* [#782] Update (generated) man pages

* [#782] We match the type, not the message
github-actions bot pushed a commit that referenced this issue Feb 13, 2024
We want to allow specifying a warning to ignore for
each URL. If no regex is specified for the warning to ignore,
we'll ignore all warnings.

The tests still pass as they are, which means that unknown
values in the configuration file are simply ignored.

* [#782] Add values to configuration file

* [#782] Parse new configuration values

* [#782] Actually ignore a warning

* [#782] Confirm side cases work as expected

* [#782] Add logging when deciding to ignore warnings

* [#782] Documentation for ignorewarningsforurls

* [#782] Update (generated) man pages

* [#782] These tests pass without network, actually

* [#782] Fix copy/paste error in symbol naming

* [#782] The regex matches the name of the warning, not the message

* [#782] Better wording

* [#782] Update (generated) man pages

* [#782] We match the type, not the message 28f6743
@cjmayo
Copy link
Contributor

cjmayo commented Feb 13, 2024

#794 merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants