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

Normalize on RFC <number> #15

Merged
merged 2 commits into from
Mar 18, 2019
Merged

Normalize on RFC <number> #15

merged 2 commits into from
Mar 18, 2019

Conversation

richardlau
Copy link
Member

Refs: nodejs/node#26695 (comment)

The first commit prohibits rfc and Rfc to enforce uppercase RFC.

As of nodejs/node@3b6344c this gives:

doc/api/dns.md
    115:65-115:72  warning  Use "RFC" instead of "rfc"  prohibited-strings  remark-lint
    558:34-558:41  warning  Use "RFC" instead of "rfc"  prohibited-strings  remark-lint
    561:52-561:59  warning  Use "RFC" instead of "rfc"  prohibited-strings  remark-lint
    650:65-650:72  warning  Use "RFC" instead of "rfc"  prohibited-strings  remark-lint
  1011:34-1011:41  warning  Use "RFC" instead of "rfc"  prohibited-strings  remark-lint
  1014:52-1014:59  warning  Use "RFC" instead of "rfc"  prohibited-strings  remark-lint

⚠ 6 warnings

The second commit enforces a space between RFC and the number. This is possibly an abuse of prohibited-strings, but it does catch the cases where the space is omitted (the user message isn't that clear, especially if you are unfamiliar with regular expressions). As of nodejs/node@3b6344c:

doc/api/buffer.md
    181:17-181:35  warning  Use "RFC <number>" instead of "[Rr][Ff][Cc]\d+"  prohibited-strings  remark-lint
    184:31-184:38  warning  Use "RFC <number>" instead of "[Rr][Ff][Cc]\d+"  prohibited-strings  remark-lint

doc/api/dns.md
    115:65-115:72  warning  Use "RFC <number>" instead of "[Rr][Ff][Cc]\d+"  prohibited-strings  remark-lint
    558:34-558:41  warning  Use "RFC <number>" instead of "[Rr][Ff][Cc]\d+"  prohibited-strings  remark-lint
    561:52-561:59  warning  Use "RFC <number>" instead of "[Rr][Ff][Cc]\d+"  prohibited-strings  remark-lint
    650:65-650:72  warning  Use "RFC <number>" instead of "[Rr][Ff][Cc]\d+"  prohibited-strings  remark-lint
  1011:34-1011:41  warning  Use "RFC <number>" instead of "[Rr][Ff][Cc]\d+"  prohibited-strings  remark-lint
  1014:52-1014:59  warning  Use "RFC <number>" instead of "[Rr][Ff][Cc]\d+"  prohibited-strings  remark-lint

doc/api/http.md
  2091:23-2092:15  warning  Use "RFC <number>" instead of "[Rr][Ff][Cc]\d+"  prohibited-strings  remark-lint

doc/api/http2.md
   3226:1-3227:17  warning  Use "RFC <number>" instead of "[Rr][Ff][Cc]\d+"  prohibited-strings  remark-lint

⚠ 10 warnings

@Trott
Copy link
Member

Trott commented Mar 18, 2019

First commit seems 👍 to me. Second commit, I think I'd prefer to see us do something upstream about Trott/remark-lint-prohibited-strings#2 to make it a bit more user-friendly.

@Trott
Copy link
Member

Trott commented Mar 18, 2019

First commit seems 👍 to me. Second commit, I think I'd prefer to see us do something upstream about Trott/remark-lint-prohibited-strings#2 to make it a bit more user-friendly.

OK, I've resolved that, and will push out a new version of that plugin, then incorporate it into this preset, and then land these changes.

Trott added a commit that referenced this pull request Mar 18, 2019
remark-lint-prohibited-strings provides better messages for regexp-y
things, which will come in handy for #15
@Trott Trott merged commit 782a2cc into nodejs:master Mar 18, 2019
@Trott
Copy link
Member

Trott commented Mar 18, 2019

Look at this beautiful output!

doc/api/buffer.md
    181:17-181:35  warning  Use "RFC <number>" instead of "RFC4648"  prohibited-strings  remark-lint
    184:31-184:38  warning  Use "RFC <number>" instead of "RFC1345"  prohibited-strings  remark-lint

doc/api/dns.md
    115:65-115:72  warning  Use "RFC" instead of "rfc"               prohibited-strings  remark-lint
    115:65-115:72  warning  Use "RFC <number>" instead of "rfc5952"  prohibited-strings  remark-lint
    558:34-558:41  warning  Use "RFC" instead of "rfc"               prohibited-strings  remark-lint
    558:34-558:41  warning  Use "RFC <number>" instead of "rfc5952"  prohibited-strings  remark-lint
    561:52-561:59  warning  Use "RFC" instead of "rfc"               prohibited-strings  remark-lint
    561:52-561:59  warning  Use "RFC <number>" instead of "rfc5952"  prohibited-strings  remark-lint
    650:65-650:72  warning  Use "RFC" instead of "rfc"               prohibited-strings  remark-lint
    650:65-650:72  warning  Use "RFC <number>" instead of "rfc5952"  prohibited-strings  remark-lint
  1011:34-1011:41  warning  Use "RFC" instead of "rfc"               prohibited-strings  remark-lint
  1011:34-1011:41  warning  Use "RFC <number>" instead of "rfc5952"  prohibited-strings  remark-lint
  1014:52-1014:59  warning  Use "RFC" instead of "rfc"               prohibited-strings  remark-lint
  1014:52-1014:59  warning  Use "RFC <number>" instead of "rfc5952"  prohibited-strings  remark-lint

doc/api/http.md
  2091:23-2092:15  warning  Use "RFC <number>" instead of "RFC2616"  prohibited-strings  remark-lint

doc/api/http2.md
   3226:1-3227:17  warning  Use "RFC <number>" instead of "RFC7540"  prohibited-strings  remark-lint

@richardlau richardlau deleted the rfc branch March 18, 2019 04:33
Marlyfleitas added a commit to Marlyfleitas/Node-remark-preset-lint that referenced this pull request Aug 26, 2022
remark-lint-prohibited-strings provides better messages for regexp-y
things, which will come in handy for nodejs/remark-preset-lint-node#15
patrickm68 added a commit to patrickm68/Node-preset-lint that referenced this pull request Sep 14, 2023
remark-lint-prohibited-strings provides better messages for regexp-y
things, which will come in handy for nodejs/remark-preset-lint-node#15
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

Successfully merging this pull request may close these issues.

2 participants