Skip to content

Conversation

@thompson-tomo
Copy link
Contributor

@thompson-tomo thompson-tomo commented Dec 6, 2025

Closes #291

This improves the robustness of the skip tag so that it is ensured that only the intended files are being skipped.

This ensures that the project readme toc is kept upto date.

This issue was introduced with #143 and observed when working on #293

@thompson-tomo thompson-tomo changed the title Add in checks for line breaks around skip tag #291 fix: Add in checks for line breaks around skip tag #291 Dec 6, 2025
@thompson-tomo
Copy link
Contributor Author

@PeterDaveHello / @AndrewSouthpaw here is a small fix for an edge case which caused this projects readme to be out of date.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a bug in the skip tag functionality to ensure files are only skipped when the skip tag appears on its own line. Previously, the skip tag would match anywhere in the file content, causing unintended files to be skipped. The fix adds validation to check that the skip tag either starts at the beginning of the file or is preceded by a newline character, ensuring only properly formatted skip tags are honored.

Key changes:

  • Updated skip tag validation logic to require proper line break placement
  • Added comprehensive test coverage for different skip tag scenarios
  • Updated project README table of contents to reflect current structure

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
lib/transform.js Added validation to ensure skip tag is on its own line (first line or preceded by newline)
test/transform-skipTag.js Renamed existing test and added two new test cases for first-line and invalid skip tag scenarios
test/fixtures/readme-with-firstline-skipTag.md New fixture file testing skip tag on the first line
test/fixtures/readme-with-invalidskipTag.md New fixture file testing invalid skip tag with trailing backtick
README.md Updated table of contents with missing sections

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <[email protected]>
@AndrewSouthpaw AndrewSouthpaw merged commit dfa656b into thlorenz:master Dec 8, 2025
5 checks passed
@thompson-tomo thompson-tomo deleted the fix/#291_EnsureLinkBreakAroundskipTag branch December 8, 2025 00:28
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.

False positive for skipping file

2 participants