tools icon indicating copy to clipboard operation
tools copied to clipboard

📎 New `--changed` argument

Open ematipico opened this issue 2 years ago • 2 comments

Description

Rome now has support for VCS, which means that we can unlock new features that make the life of developers easier!

One of these features is the addition of a new argument called --changed to the CLI. When we pass this argument, Rome will execute check/format/etc. only to those files that were changed.

Technical details

I am still determining the implementation of this argument. There are two alternatives:

  1. execute the command via Command, we pass the proper arguments to the git program, and we read the output that was generated. Although I don't know yet what's the correct command/arguments to get an accurate output
  2. Use the crate git2. While this crate is phenomenal, its size is not small (207kb)

What do you guys think?

ematipico avatar May 09 '23 09:05 ematipico

One issue I see is that a user could expect to apply the linter/checker only on staged parts of the changed files, leaving unchecked the unstaged parts.

Conaclos avatar May 09 '23 10:05 Conaclos

One issue I see is that a user could expect to apply the linter/checker only on staged parts of the changed files, leaving unchecked the unstaged parts.

We wouldn't care about "what" changed in a file. We would only care about if it's changed. Even adding a white space or a new line would count as changed file, and we would need to check it ALL.

ematipico avatar May 09 '23 14:05 ematipico