Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logging warnings to stderr causes pipeline to fail #1205

Closed
larkworthy opened this issue Jul 5, 2021 · 2 comments
Closed

Logging warnings to stderr causes pipeline to fail #1205

larkworthy opened this issue Jul 5, 2021 · 2 comments
Labels
Question This issue is requesting information about dotnet-format

Comments

@larkworthy
Copy link

We use a step in our Azure DevOps pipeline to run dotnet-format. It's run as a command-line step that fails when there is output on stderr. This is the step:

  steps:
  - task: CmdLine@2
    inputs:
      script: '"$(dotnet-format)" --check --verbosity diagnostic'
      failOnStderr: true

The change to Log warnings and errors to the standard error stream (982) in the latest release causes the pipeline to fail on warnings.

Is it possible to have an option to only write errors to stderr? Or, are there other options to support format validation in a pipeline?

@JoeRobich
Copy link
Member

@larkworthy With the --check option we return a non-zero exit code when there are code changes. This indicates to AzDO that the task failed.

@JoeRobich JoeRobich added the Question This issue is requesting information about dotnet-format label Jul 6, 2021
@larkworthy
Copy link
Author

Thanks, @JoeRobich. I updated our pipeline and the dotnet-format version, and it's working as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Question This issue is requesting information about dotnet-format
Projects
None yet
Development

No branches or pull requests

2 participants