get-alex / alex

Catch insensitive, inconsiderate writing
https://alexjs.com
MIT License
4.81k stars 208 forks source link

Violation from URLs should be skipped because URL links cannot be changed #341

Closed tymonx closed 1 year ago

tymonx commented 1 year ago

Subject of the issue

Violation from URLs should be skipped because URL links cannot be changed. Example:

https://www.freedesktop.org/software/systemd/man/systemd-analyze.html

It contains word man.

Your environment

11.0.0
NODE_VERSION=19.8.1
YARN_VERSION=1.22.19

Steps to reproduce

  1. Create file with URL link:
echo "https://www.freedesktop.org/software/systemd/man/systemd-analyze.html" > README.md
  1. Run alex:
podman run -it --rm --volume "$(pwd):/alex:ro,z" --workdir "/alex" registry.gitlab.com/pipeline-components/alex:0.21.9 --why .

Expected behaviour

It should return status code 0 (success) without printing anything to standard output or error output.

Actual behaviour

It returns status code 1 and prints:

README.md
  1:46-1:49  warning  `man` may be insensitive, use `people`, `persons`, `folks` instead  gals-man  retext-equality

⚠ 1 warning
wooorm commented 1 year ago

alex takes markdown (or MDX, or HTML) as input. I recommend using a markdown link around URLs: [descriptive text](url).

etrobert commented 1 year ago

URLs can be changed by the owner (with some effort), it makes sense to me to bring up insensitive words in them.

The example brought up uses man as an abbreviation of manual, so it an unfortunate exception.

You could disable this rule for this line

<!--alex ignore gals-man-->
wooorm commented 1 year ago

Hey!

If you use markdown or HTML, you can use the markdown (or HTML) structures to turn links into links: [descriptive text](the-url).

This is intentional: that we check prose. And that we don’t check syntax. Use the syntax provided by the markdown (or HTML) language and it works here!

Also agreeing with @etrobert that anything could be checked. If you want that, use --text!

Closing as you can use markdown/HTML syntax!