-
Notifications
You must be signed in to change notification settings - Fork 17
Enable raw link checking in code blocks by default with opt-out flag #115
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
base: master
Are you sure you want to change the base?
Conversation
…de blocks Co-authored-by: becheran <22472855+becheran@users.noreply.github.com>
Co-authored-by: becheran <22472855+becheran@users.noreply.github.com>
…rn matching Co-authored-by: becheran <22472855+becheran@users.noreply.github.com>
becheran
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot revert the logic and always check for raw links in codeblocks etc.. Rename the flag to something such as --disable-raw-link-check or something similar to indicate that it disables the ability to check raw links inside textblocks or citation etc.
Co-authored-by: becheran <22472855+becheran@users.noreply.github.com>
|
@copilot resolve merge conflics |
- Integrated new --files option from master - Maintained inverted logic for raw link checking (enabled by default) - Updated field name from check_links_in_code_blocks to disable_raw_link_check - Fixed tests to reflect new default behavior - Added TagEnd handling to avoid extracting URLs from within markdown links Co-authored-by: becheran <22472855+becheran@users.noreply.github.com>
Merge conflicts resolved in commit ff90290. Integrated the new Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
README.md
Outdated
| | `--throttle` | `-T` | Number of milliseconds to wait in between web requests to the same host. Default is zero which means no throttling. Set this if you need to slow down the web request frequency to avoid `429 - Too Many Requests` responses. For example with `--throttle 15`, between each http check to the same host, 15 ms will be waited. Note that this setting can slow down the link checker. | | ||
| | `--csv` | | Path to csv file which contains all failed requests and warnings in the format `source,line,column,target,severity`. The severity column contains `ERR` for errors and `WARN` for warnings. | | ||
| | `--disable-raw-link-check` | `-c` | Disable checking of raw links in code blocks and other text. By default, raw HTTP(S) URLs are extracted and checked from code blocks and inline code. | | ||
| | `--csv` | | Path to csv file which contains all failed requests in the format `source,line,column,target` | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do not change csv readme message from main
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in commit 5f567ab. Updated CSV description to match master branch: "Path to csv file which contains all failed requests and warnings in the format source,line,column,target,severity. The severity column contains ERR for errors and WARN for warnings."
src/lib.rs
Outdated
| CSVFile: {:?} | ||
| Files: {:?} | ||
| DisableRawLinkCheck: {} | ||
| Files: {:?}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comma seems wrong here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in commit 5f567ab. Removed the extra comma after Files: {:?} in the format string.
- Updated CSV description in README to match master branch (includes warnings and severity column) - Fixed formatting issue in src/lib.rs (removed extra comma in format string) - Fixed new test compilation errors from GFM checkbox tests (added missing config parameter) - All 126 tests passing Co-authored-by: becheran <22472855+becheran@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot fix failing pipeline runs. Tests are failing |
…re_recursive test - Added missing disable_raw_link_check field to OptionalConfig in tests/gitignore_recursive.rs - This test was added in recent merge and was missing the new field - All 127 tests now passing - No clippy warnings Co-authored-by: becheran <22472855+becheran@users.noreply.github.com>
Fixed in commit 473192e. The test failure was due to a missing Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
becheran
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add an e2e test which tests the new functionality by detecting a link in a code block
- Created test markdown file (code_block_links.md) with various code block scenarios - Added end_to_end_code_block_links_enabled test to verify raw links are checked by default - Added end_to_end_code_block_links_disabled test to verify disable flag works - Tests verify both inline code and fenced code blocks are handled correctly - All 130 tests passing, no clippy warnings Co-authored-by: becheran <22472855+becheran@users.noreply.github.com>
Added in commit 3e243b6. Created two E2E tests:
The tests use a new test file
All 130 tests passing. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot disables codblock checks for own readme check in test_own_readme ci |
- Added --disable-raw-link-check flag to the test_own_readme CI job - This prevents the CI from checking URLs in inline code/code blocks in README - Without this flag, the new default behavior would check URLs in inline code like `http*://crates.io*` - Maintains backward compatibility for the README CI test Co-authored-by: becheran <22472855+becheran@users.noreply.github.com>
Fixed in commit e582698. Added Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Enable raw link checking in code blocks by default with opt-out flag
Successfully resolved all compilation errors, test failures, and code review feedback.
Latest Changes
--disable-raw-link-checkflag totest_own_readmeCI job to maintain backward compatibility for README testing--disable-raw-link-checkflag properly disables the featurePrevious Changes
disable_raw_link_checkfield to newgitignore_recursivetest from recent mergefind_links()method to include the required&Configparameterdisable_raw_link_check: Noneto allOptionalConfiginitializers in test filescargo fmtto ensure consistent code styleFiles Updated
.github/workflows/ci.yml- Added--disable-raw-link-checkflag to test_own_readme jobtests/test_files/code_block_links.md- New test file with code blocks containing URLstests/end_to_end.rs- Added two new E2E tests for the featuretests/gitignore_recursive.rs- Added missing disable_raw_link_check fieldREADME.md- Updated CSV option description to match mastersrc/lib.rs- Removed extra comma in format stringsrc/link_extractors/markdown_link_extractor.rs- Fixed test functionssrc/link_extractors/html_link_extractor.rs- Fixed test functionstests/end_to_end.rs- Added missing field to configstests/end_to_end_mock.rs- Added missing field to configscargo fmtVerification
✅ All 130 tests passing (including 2 new E2E tests)
✅ No clippy warnings
✅ Code properly formatted
✅ Code review feedback addressed
✅ CI/CD pipeline tests fixed
✅ Feature fully tested with E2E scenarios
✅ README CI test updated to maintain backward compatibility
✅ Ready for merge
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.