-
Notifications
You must be signed in to change notification settings - Fork 653
feat(rome_service): add a configuration option to set the file size limit of the workspace #3530
Conversation
✅ Deploy Preview for rometools canceled.
|
What do you think of adding a CLI option as well? |
```block | ||
check.js lint ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ | ||
|
||
× Size of check.js is 27 B which exceeds the project maximum of 16 B. The file size limit exists to prevent us inadvertently slowing down and loading large files that we shouldn't. |
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.
Can we add an advice telling people how to increase the maximum file size?
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.
I plan to do this once RomeError
has been migrated to implement Diagnostic
, currently it only implements Error
meaning it gets printed through the Display
adapter and may not render markup in its message or show additional advices
|
||
pub const CONFIG_FILE_SIZE_LIMIT: &str = r#"{ | ||
"files": { | ||
"maxSize": 16 |
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.
What other options to you see under files
. ignore
?
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.
Yes it would be possible to introduce a project-wide ignore list, and we could also bring back the maxSizeIgnore
options from Rome JS to specify paths or patterns that ignore the file size limit
f1779f0
to
9a26965
Compare
Summary
This PR introduces a
files.maxSize
configuration to set the maximum allowed file size for the workspace. I've also reworded the error message that's emitted for skipped files to use the same messaging as Rome JS, that focuses on performance and doesn't mention parsing.Test Plan
I've added additional test cases for the CLI to check that the option is correctly applied, and update existing snapshots for the tests of the default limit with the new error message.