tools icon indicating copy to clipboard operation
tools copied to clipboard

๐Ÿ› Rome returns non-zero exit code when called with excluded filename

Open zachequi opened this issue 1 year ago โ€ข 3 comments

Environment information

CLI:
  Version:                      12.1.3
  Color support:                true

Platform:
  CPU Architecture:             x86_64
  OS:                           linux

Environment:
  ROME_LOG_DIR:                 unset
  NO_COLOR:                     unset
  TERM:                         "xterm-256color"
  JS_RUNTIME_VERSION:           "v18.7.0"
  JS_RUNTIME_NAME:              "node"
  NODE_PACKAGE_MANAGER:         "yarn/3.6.0"

Rome Configuration:
  Status:                       Loaded successfully
  Formatter disabled:           false
  Linter disabled:              false
  Organize imports disabled:    true
  VCS disabled:                 true

Workspace:
  Open Documents:               0

Discovering running Rome servers...

Running Rome Server: โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”

i The client isn't connected to any server but rage discovered this running Rome server.

Server:
  Version:                      12.1.3
  Name:                         rome_lsp
  CPU Architecture:             x86_64
  OS:                           linux

Workspace:
  Open Documents:               0

Other Active Server Workspaces:

Workspace:
  Open Documents:               5
  Client Name:                  Visual Studio Code
  Client Version:               1.79.2

Rome Server Log:

! Please review the content of the log file before sharing it publicly as it may contain sensitive information:
  * Path names that may reveal your name, a project name, or the name of your employer.
  * Source code
<Snipped to not include proprietary code information>

What happened?

  1. Setup rome to exclude a certain file pattern, e.g. *.generated.ts
  2. attempt to run rome on a set of files including at least one that is excluded, e.g. rome check --apply foo.ts bar.generated.ts
  3. Rome returns an io/InternalError and exit code of 1.
echo $./api.generated.ts lint โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”

  โœ– The file ./api.generated.ts was ignored
  

Fixed 1 file(s) in 676ยตs
Skipped 1 file(s)
internalError/io โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”

  โœ– No files were processed in the specified paths.
$ echo $?
1

Note this is a bit of a contrived example for simplicity of replication, in reality this is a common occurrence with e.g. lint-staged

Expected result

Rome should skip the excluded file gracefully and continue linting the remaining files returning a status code indicating whether the linting/formatting succeeded on the non-excluded files.

Code of Conduct

  • [X] I agree to follow Rome's Code of Conduct

zachequi avatar Jul 10 '23 17:07 zachequi