sindresorhus / awesome

😎 Awesome lists about all kinds of interesting topics
Creative Commons Zero v1.0 Universal
333.38k stars 27.9k forks source link

Tools for enforcing awesome-style? #569

Closed paulirish closed 5 years ago

paulirish commented 8 years ago

In the manifesto there are a few suggestions and requirements. For example..

style

Have any list maintainers written some scripts to either lint for style issues? Also interested in boring build scripts to automate TOC generation with DocToc, etc.

sindresorhus commented 8 years ago

:+1: Would be nice to just be able to tell people to add a Travis check. Very few follow the guidelines and I do a lot of manual job commenting on that.

The only prior art I know of is an awesome bot (see https://github.com/sindresorhus/awesome/pull/478), but it only checks for outdated links, so not very useful.

sindresorhus commented 8 years ago

@wooorm Does something like this exist in the retext/remark ecosystem?

wooorm commented 8 years ago

Hi Sindre, Paul, great idea!

no markdown errors, consistent style

I believe remark, the markdown processor, could help here. Probably though its lint plugin, which checks patterns in markdown and triggers warnings. It checks for several possible style violations (e.g., emphasis markers, * or _), which each can be configured, turned on, or turned off. And, it supports external rules, for example: vhf/remark-lint-alphabetize-lists, which ensures lists are sorted properly.

Which brings me to a similar project, vhf/free-programming-books-lint, which implemented the aforementioned rule. This project wraps remark and remark-lint and enforces the free-programming-book style in their .travis.yml file.

P.S. also interesting: remark-validate-links

table-of-contents

Maybe remark-toc, or of course one of the non-remark plugins if you want more control.

grammatically correct, no typos

Nothing good so far. I investigated this but there’s no good solution to implement this in a Travis task, yet. I’m half-way with n-spell, plain-JavaScript (Hunspell) spelling, which will make this possible. But I got bored...


Hope this helps!

sobolevn commented 8 years ago

When creating awesome-cryptography, I was in doubt with how to enforce the style-consistency. Thanks for @wooorm for his awesome remark-lint.

My solutions was:

  1. Validating Markdown style with remark-lint
  2. Validating that list-items are ordered alphabetically: remark-lint-alphabetize-lists
  3. Validating links to be unique and alive: remark-lint-are-links-valid
  4. Checking that list items are ending with period: remark-lint-list-item-punctuation

Here's the setup: package.json

sindresorhus commented 8 years ago

I've started work on an official Awesome linter. ✨

I could use some feedback and help → https://github.com/sindresorhus/awesome-lint/issues/3