Skip to content

Add try catch around read directories and have new error conditions when files cannot be read, plus test - #75

Merged
reidbaker merged 6 commits into
flutter:mainfrom
reidbaker:r-handle-directory-permission-errors
Apr 13, 2026
Merged

reidbaker merged 6 commits into
flutter:mainfrom
reidbaker:r-handle-directory-permission-errors

Conversation

@reidbaker

@reidbaker reidbaker commented Apr 13, 2026 •

Copy link
Copy Markdown
Contributor

This better handles when skills are symlinked to directories that may not be accessible

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read the Flutter Style Guide recently, and have followed its advice.
  • I signed the CLA.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

@reidbaker reidbaker changed the title Add try catch around read directorys and have new error conditions when files cannot be read, plus test Add try catch around read directories and have new error conditions when files cannot be read, plus test Apr 13, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request enhances the Validator class to handle FileSystemException and other unexpected errors when reading the SKILL.md file, adding specific error IDs for these scenarios. It also introduces a test case for inaccessible files and refactors path construction to use the path package. The review feedback suggests using _getSeverity for the new error types to allow for severity overrides and recommends wrapping the permission-altering logic in tests within a try-finally block to ensure proper cleanup even if assertions fail.

Comment thread tool/dart_skills_lint/lib/src/validator.dart
Comment thread tool/dart_skills_lint/test/directory_structure_test.dart Outdated
@reidbaker
reidbaker merged commit f16bec2 into flutter:main Apr 13, 2026
7 checks passed
@reidbaker
reidbaker deleted the r-handle-directory-permission-errors branch April 13, 2026 18:22
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.

1 participant