lukeapage / node-markdown-spellcheck

spellchecks markdown files
145 stars 58 forks source link

support no color #36

Open lukeapage opened 9 years ago

adamdmharvey commented 6 years ago

Another thumbs up for this. At the moment, there are some challenges when running mdspell through a Jenkins pipeline. Jenkins traditional has a plugin to support AnsiColor, while Jenkins with Blue Ocean Pluging supports ANSI color "inherently", but one breaks the other, so there's no way to get coloring to work in both? https://issues.jenkins-ci.org/browse/JENKINS-39536 https://issues.jenkins-ci.org/browse/JENKINS-46324

If mdspell had an option in the report to better report on the identified word that would be ideal for including into CI/CD pipelines w/o color support:

Current: image

Possible Example:

C:\test>mdspell -r README.md
    README.md
        1 | This is a test of the [[[emergancy]]] broadcast system.

>> 1 spelling error found in 1 file
TheQueasle commented 5 years ago

I stumbled onto this issue while attempting to get color output from mdspell -r .. to show up in the output of a GitLab pipeline report.

After some digging around I found that this project (node-markdown-spellcheck) uses Chalk for rendering color on the terminal.

Using the environment variable FORCE_COLOR=1 you can force Chalk to output the color codes.

Using the aforementioned environment variable, I now get colored output from my GitLab CI pipeline logic.

GitLab CI Yaml Example:

variables:
  FORCE_COLOR: 1

Not sure if about Jenkins though as I've never used it, but hopefully this comment helps out someone :grin:

fbertsch commented 2 years ago

Using the environment variable FORCE_COLOR=1 you can force Chalk to output the color codes.

Thank you! This worked for GH actions as well:

    var:
      FORCE_COLOR=1