tools
tools copied to clipboard
fix(rome_cli): Allow to run on read-only file systems
Fixes an issue where Rome could not process files on read-only file systems during traversal, where write access to the file system was not required.
This is required to execute Rome in isolated environments (sandboxes).
Example - Error message when running the check command on a read-only file system
$ rome check .
/test.js internalError/io ━━━━━━━━━━
× Read-only file system (os error 30)
Checked 0 file(s) in 939µs
Skipped 1 file(s)
Rome encountered an unexpected error
This is a bug in Rome, not an error in your code, and we would appreciate it if you could report it to https://github.com/rome/tools/issues/ along with the following information to help us fixing the issue:
Source Location: crates/rome_cli/src/traversal.rs:210:8
Thread Name: main
Message: attempt to subtract with overflow
References
- Unix: os error 30 (EROFS) (Documentation)
Deploy Preview for docs-rometools ready!
Built without sensitive environment variables
Name | Link |
---|---|
Latest commit | ac18d624769f505def47c1edb6465bb1c4faac76 |
Latest deploy log | https://app.netlify.com/sites/docs-rometools/deploys/6387bec0ae1b3e00080bbc42 |
Deploy Preview | https://deploy-preview-3851--docs-rometools.netlify.app/playground |
Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site settings.
The additional variant increased the complexity of the implementation. I am working on tests for this. Please do not merge yet.
I added integration tests for the check and format commands.
I replaced the std::fs tests with the MemoryFileSystem in read-only mode. There was another bug, where unnecessary write access to the underlying file system was required to read the rome.json configuration file. It is good that we have the tests.