+
Skip to content
This repository was archived by the owner on Aug 31, 2023. It is now read-only.

feat(rome_service): add a configuration option to set the file size limit of the workspace #3530

Merged
merged 5 commits into from
Oct 28, 2022

Conversation

leops
Copy link
Contributor

@leops leops commented Oct 28, 2022

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.

@leops leops requested a review from ematipico as a code owner October 28, 2022 10:11
@netlify
Copy link

netlify bot commented Oct 28, 2022

Deploy Preview for rometools canceled.

Name Link
🔨 Latest commit 9a26965
🔍 Latest deploy log https://app.netlify.com/sites/rometools/deploys/635bdf6b7677b7000874b643

@leops leops temporarily deployed to netlify-playground October 28, 2022 10:11 Inactive
@leops leops requested a review from a team October 28, 2022 10:15
@leops leops temporarily deployed to netlify-playground October 28, 2022 10:15 Inactive
@github-actions
Copy link

github-actions bot commented Oct 28, 2022

@MichaReiser
Copy link
Contributor

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.
Copy link
Contributor

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?

Copy link
Contributor Author

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
Copy link
Contributor

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?

Copy link
Contributor Author

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

@ematipico ematipico added this to the 10.0.0 milestone Oct 28, 2022
@ematipico ematipico added A-CLI Area: CLI A-Core Area: core labels Oct 28, 2022
@leops leops temporarily deployed to netlify-playground October 28, 2022 12:25 Inactive
@leops leops temporarily deployed to netlify-playground October 28, 2022 13:09 Inactive
@leops leops force-pushed the feature/files-max-size branch from f1779f0 to 9a26965 Compare October 28, 2022 13:55
@leops leops temporarily deployed to netlify-playground October 28, 2022 13:55 Inactive
@leops leops merged commit bc3273b into main Oct 28, 2022
@leops leops deleted the feature/files-max-size branch October 28, 2022 14:41
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-CLI Area: CLI A-Core Area: core
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载