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

Question: is there a way to tell write-good to ignore code blocks? #63

Open
jputrino opened this issue Jan 24, 2017 · 8 comments
Open

Comments

@jputrino
Copy link

jputrino commented Jan 24, 2017

Hi! Tech writer here, so please excuse if there is an obvious answer that I'm just not aware of. I'm using write-good in a bash script to test my documentation before publishing and am getting 'failures' based on content in code blocks. I'd like to be able to tell it to skip these instead.

Example:
This code block:

::

   user@foo# show bar
         bar monitor http server-app4_10.128.10.240_8080 {

... causes this write-good result:

         bar monitor http server-app4_10.128.10.240_8080 {
         ^^^
"bar" is repeated on line 220 at column 9

I'm also not sure if this might be an issue with write-good, since the word it flags as a duplicate is on a new line.

Thanks!

@btford
Copy link
Owner

btford commented Jan 25, 2017

Duplicate of #62, but I'm willing to reconsider such a feature if it's common enough.

My original objection is that this feature is a slippery slope; if write-good supports markdown, why not <some other format>?

@jputrino
Copy link
Author

@btford - I can certainly appreciate that argument! If I can get my devs to help write the code, would you be willing to consider adding it in?

@blueyed
Copy link

blueyed commented Apr 26, 2017

@jputrino
Speaking out of experience: a PR would always help!

@btford
Copy link
Owner

btford commented Apr 26, 2017

I would gladly accept a PR.

@jputrino
Copy link
Author

Thanks @blueyed and @btford! I'll talk to the developers to see if anyone is interested in helping.

@tykeal
Copy link

tykeal commented Aug 18, 2020

Instead of opening a new issue, just to have it closed as a duplicate, I figured I would ask on the issue that is still open and semi-relevant.

Is there a way to dynamically disable / enable checks in the files themselves? This would be something that would be useful for all the folks asking for detecting code blocks and such.

For instance with ShellCheck you can have preceding comment lines that have a directive similar to:

# shellcheck disable=SC2086

Which would disable the double quote check on the next line.

With yamllint you can do things like:

# yamllint disable-line rule:line-length

which disable the rule for the next line or

# yamllint disable rule:line-length
a very long line (not that this is since it's just an example)
# yamllint enable
# this re-enables that _last_ disabled rule as the disablement seems to be done as a stack

Which allows you to disable for a block / till the end of the file if the enable is never added back.

Having a comment disable / enable method that supports single line and block would resolve these issues for everyone and also make the tool more flexible.

@dbalatero
Copy link

image

For more examples of where this breaks, here's a code block in a software README.md that contains a duplicated term (0x). This isn't correct to ding for since it's just trying to give some example commands to run.

@glennhefley
Copy link

Sweet. What phenomenal timing. I'm actually here to ask basically the same request. I work with a great deal of dialog and this may help with my needs as well.

Anyway, good on you and respect. I'll make do for now and perhaps touch on this later.

g-out

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants