Skip to content

Allow output to file with different format to output to console #2388

@ngnpope

Description

@ngnpope

Currently, when running in CI I have to do the following, e.g. in a (simplified) .gitlab-ci.yml:

lint:
  script:
    - ...
    - ruff .
    - ruff --format=gitlab . > quality.json
  artifacts:
    reports:
      codequality: quality.json

I'd like to keep the text output in the job output, but also make use of the capabilities GitLab provides to display violations.

Now, ruff is super fast ⚡, so running twice isn't a pain, but it seems suboptimal. Could we enable one of the following?

  • ruff --format=text --output=gitlab:/path/to/quality.json . ← dedicated --output option
  • ruff --format=text --format=gitlab:/path/to/quality.json . ← allow multiple --format with filename
  • ruff --format=text,gitlab:/path/to/quality.json . ← allow multiple values in --format

Metadata

Metadata

Assignees

No one assigned

    Labels

    cliRelated to the command-line interfacewishNot on the current roadmap; maybe in the future

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions