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

lint README and add gh workflow to do so #2784

Closed
wants to merge 5 commits into from

Conversation

naseemkullah
Copy link

@naseemkullah naseemkullah commented Jan 8, 2021

Signed-off-by: naseemkullah naseem@transit.app

Checklist

@mcollina
Copy link
Member

mcollina commented Jan 8, 2021

Thanks! This is actually nice.

docs/Encapsulation.md:22:1 MD004/ul-style Unordered list style [Expected: asterisk; Actual: dash]

@naseemkullah
Copy link
Author

Thanks! This is actually nice.

docs/Encapsulation.md:22:1 MD004/ul-style Unordered list style [Expected: asterisk; Actual: dash]

My pleasure! Fixed, pardon the force push! :)

Copy link
Member

@RafaelGSS RafaelGSS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Copy link
Member

@jsumners jsumners left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm extremely hesitant to accept these automated changes. There are some significant formatting changes I have called out, and very likely many that I haven't.

CONTRIBUTING.md Outdated Show resolved Hide resolved
PROJECT_CHARTER.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
docs/Ecosystem.md Outdated Show resolved Hide resolved
docs/Errors.md Outdated Show resolved Hide resolved
docs/Style-Guide.md Outdated Show resolved Hide resolved
docs/Testing.md Outdated Show resolved Hide resolved
docs/Testing.md Outdated Show resolved Hide resolved
docs/TypeScript.md Outdated Show resolved Hide resolved
docs/TypeScript.md Outdated Show resolved Hide resolved
@mcollina
Copy link
Member

mcollina commented Jan 9, 2021

Then let's not land this.

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think these automated changes are good enough for us.

@naseemkullah
Copy link
Author

In fact most thing @jsumners pointed it were manual errors on my end that the automation did not touch. I'll try again, this time only with automated changes and add any remaining broken rules to the ignored rules file.

@naseemkullah
Copy link
Author

More rules have been ignored and a much lighter touch has been applied, PTAL.

@jsumners
Copy link
Member

Can we re-start this PR in a new one that addresses files in smaller, easier to digest, chunks? For example, maybe start off with the main README and one or two other documents. That would make it easier to review the rules and agree upon them before they are applied across everything. As we agree on the initial set of documents, a few more can be added, and so on until we have covered them all. I realize it will take more time, but this PR is really too much to review.

@naseemkullah
Copy link
Author

Sure!

@naseemkullah
Copy link
Author

PTAL @jsumners this PR has been restarted from scratch, only README is touched and most rules are turned off for the time being. Just blank lines and spaces. :)

@naseemkullah naseemkullah changed the title lint markdown and add gh workflow to do so lint README and add gh workflow to do so Jan 11, 2021
.markdownlint.json Outdated Show resolved Hide resolved
README.md Show resolved Hide resolved
.markdownlint.yaml Outdated Show resolved Hide resolved
Copy link
Member

@jsumners jsumners left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM so far

@Eomm Eomm added the documentation Improvements or additions to documentation label Jan 11, 2021
Copy link
Member

@RafaelGSS RafaelGSS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a better approach, for sure. LGTM.

@mcollina
Copy link
Member

Would you mind to add a script in package.json to run the markdown linting?

@naseemkullah
Copy link
Author

Would you mind to add a script in package.json to run the markdown linting?

Good idea

@naseemkullah
Copy link
Author

Would you mind to add a script in package.json to run the markdown linting?

done!

package.json Outdated
@@ -20,7 +20,9 @@
"test:ci": "npm run lint && npm run unit -- --cov --coverage-report=lcovonly && npm run test:typescript",
"bench": "branchcmp -r 2 -g -s \"npm run benchmark\"",
"benchmark": "npx concurrently -k -s first \"node ./examples/simple.js\" \"npx autocannon -c 100 -d 5 -p 10 localhost:3000/\"",
"license-checker": "license-checker --production --onlyAllow=\"MIT;ISC;BSD-3-Clause;BSD-2-Clause\""
"license-checker": "license-checker --production --onlyAllow=\"MIT;ISC;BSD-3-Clause;BSD-2-Clause\"",
"markdownlint": "markdownlint '**/*.md'",
Copy link
Member

@jsumners jsumners Jan 12, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This tool is really annoying. I can't find any documentation about what options it accepts in the configuration dotfile to determine if the target file list can be specified there instead of repeated throughout our code base.

As an example of what I'm looking for, https://node-tap.org/docs/configuring/ clearly shows how to generate a default configuration file. It also shows that --files can be added to a configuration like so:

files:
  - index.test.js
  - 'test/**/*.test.js'

Do you know if this same thing can be done with the Markdown lint tool?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure, I'm sorry you are annoyed, I can close this PR, the purpose was to improve document quality but the amount of grief it seems to cause you does not warrant it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not against the PR. I'm just frustrated with the tool's lack of transparency. As best I can tell, markdownlint-cli is the thing that reads the configuration and kicks off the linter. But that tool's readme doesn't provide a list, or a link to a list, of all possible configuration options.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's true.

I've filed:
igorshubovych/markdownlint-cli#158
igorshubovych/markdownlint-cli#159

maybe see what they say and can decide if the tool will be worth fastify maintainers' while.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've ported to markdownlint-cli2 PTAL and let me know your preference!

The files we want to lint still need to be specified every time it is invoked though.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The openjs foundation uses this tool remark that seems more documented to lint MD files

@DavidAnson
Copy link

If you want to be paranoid, it may be desirable to explicitly list the enabled rules in the configuration as well so that new rules aren't applied unexpectedly.

Additionally, you may choose to set default:false and then list ONLY the enabled rules so that it's exceedingly clear what IS applied (vs. how it looks now listing what is NOT being applied).

I have also commented on both issues opened against the CLI. Thanks!

naseemkullah added 4 commits January 17, 2021 13:38
Signed-off-by: naseemkullah <naseem@transit.app>

After discussing with project maintainers, majority of rules are
ignored, though spacing is still improved. Only README is added for now.

More markdown files can be added and rules turned on on a per-need basis.
Signed-off-by: naseemkullah <naseem@transit.app>
Signed-off-by: naseemkullah <naseem@transit.app>
Signed-off-by: naseemkullah <naseem@transit.app>
@naseemkullah naseemkullah force-pushed the markdownlint branch 2 times, most recently from fe185fb to 058c71f Compare January 17, 2021 18:43
package.json Outdated Show resolved Hide resolved
To see if fasitfy maintainers prefer this.
Copy link
Member

@jsumners jsumners left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the difference with these new changes?

@naseemkullah
Copy link
Author

What is the difference with these new changes?

Not much in fact.

The new underlying CLI has more config options, none of which we use today but they are easy to find in the README.

Also thought I'd give it a try as the maintainer of both this CLI and it's underlying library (markdownlint) @DavidAnson has been very responsive to our feedback and may add a files config option in the future.

Base automatically changed from master to main March 26, 2021 12:02
@stale
Copy link

stale bot commented Jun 26, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale Issue or pr with more than 15 days of inactivity. label Jun 26, 2021
@mcollina mcollina closed this Aug 9, 2021
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Improvements or additions to documentation stale Issue or pr with more than 15 days of inactivity.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants