Open marcelschork opened 1 week ago
It looks like that environment does not support the formatting/coloring we are doing using chalk. Such environments should be detected by chalk itself (through supports-color). But I recall similar issues with Azure in the past.
If possible, could you test whether setting the environment variable CI=true
for the ui5lint command resolves this?
I just tested it. Setting the env variable CI to true and running the linter does not solve the issue. Then I checked the chalk GitHub repo and FORCE_COLOR=0
is what I was looking for. We may can add it to the documentation.
Expected Behavior
When saving the results of the linter to a file the ANSI codes should always be removed.
Current Behavior
When saving the results of the linter to a file within a CI pipeline on AzDO the ANSI codes were not removed. Running the same command on the terminal (MacOS 13.2.1 + zsh/bash) the ANSI codes are removed and everything is fine.
We are writing the lint results back to a pull request in AzDO and this is how it is looking like (without the sed workaround being applied)
I did not yet check any other CI/CD platform like GitHub Actions, Jenkins, etc.
Steps to Reproduce the Issue
steps:
sed 's/\x1b[[0-9;]*m//g' $(Build.ArtifactStagingDirectory)/ui5lint-results.txt > $(Build.ArtifactStagingDirectory)/ui5lint-results-no-color.txt # workaround
displayName: "🔍 Run ui5lint..."
Context
pnpm 9.4.0
Ubuntu 22.04