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

feat(rome_cli): rome check via stdin #4430

Merged
merged 3 commits into from
May 2, 2023
Merged

feat(rome_cli): rome check via stdin #4430

merged 3 commits into from
May 2, 2023

Conversation

ematipico
Copy link
Contributor

@ematipico ematipico commented May 1, 2023

Summary

This PR allows running the command rome check via standard input.

Example:

cat file.js | rome check --apply-unsafe --organize-imports-enabled=true --stdin-file-path=file.js > file.js

In order to make the command rome check more ergonomic with stdin, I created three new flags:

  • --formatter-enabled
  • --linter-enabled
  • --organize-imports-enabled

By doing so, a user can apply the type of change to the input. These are the same flags that we have in the rome ci command, and they behave in the same way.

These new flags can be used even without stdin.

Test Plan

Added new test cases to ensure the changes are applied based on the features enabled/disabled.

Changelog

  • The PR requires a changelog line

Documentation

  • The PR requires documentation
  • I will create a new PR to update the documentation

@netlify
Copy link

netlify bot commented May 1, 2023

Deploy Preview for docs-rometools canceled.

Name Link
🔨 Latest commit 5d0c2bf
🔍 Latest deploy log https://app.netlify.com/sites/docs-rometools/deploys/644f8a9b8a83e900076bec09

@github-actions github-actions bot added A-CLI Area: CLI A-Project Area: project configuration and loading labels May 1, 2023
@ematipico ematipico merged commit 2cb6b01 into main May 2, 2023
@ematipico ematipico deleted the feat/check-via-stdin branch May 2, 2023 09:30
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-CLI Area: CLI A-Project Area: project configuration and loading
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant