fix: improve lint-readme.js error handling and messages#130
Merged
joshjohanning merged 7 commits intomainfrom Oct 2, 2025
Merged
fix: improve lint-readme.js error handling and messages#130joshjohanning merged 7 commits intomainfrom
joshjohanning merged 7 commits intomainfrom
Conversation
Owner
joshjohanning
commented
Oct 2, 2025
- Add check for files tracked in Git but missing from filesystem
- Update error message to distinguish between files and directories
- Prevent crashes when staged files have been deleted locally
- Add fs.existsSync() checks before fs.statSync() calls
📋 Lint Results⚡ ./gh-cli scripts🔧 ./scripts scriptsLint results updated at Thu Oct 2 19:09:55 UTC 2025 |
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR improves the robustness of the lint-readme.js script by adding better error handling for missing files and enhancing error messages to distinguish between files, directories, and items that don't exist.
- Adds filesystem existence checks before attempting to access file stats
- Introduces a helper function to determine item types (file/directory/non-existent)
- Updates error messages to be more specific about whether an item is a file or directory
- Prevents crashes when Git-tracked files have been deleted locally
… additional comments
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.