sindresorhus / awesome-lint

Linter for Awesome lists
MIT License
600 stars 56 forks source link

Apostrophes and interpuncts in the first word of the description cause an error #153

Closed steven2358 closed 1 year ago

steven2358 commented 1 year ago

I get the error

List item description must start with valid casing

on these link descriptions

- [GPT-3](https://openai.com/api/) - OpenAI's API provides access to GPT-3, which performs a wide variety of natural language tasks, and Codex, which translates natural language to code. - [DALL·E 2](https://openai.com/dall-e-2/) - DALL·E 2 by OpenAI is a new AI system that can create realistic images and art from a description in natural language.

Since the descriptions start with valid casing, I assume the error is triggered because the item titles are capital-only. These items do follow the Awesome List guidelines though.

sindresorhus commented 1 year ago

Yeah. This is a bug.

steven2358 commented 1 year ago

Ok, I found the root of the problem. The error was caused by special characters in the first word of the description, such as an apostrophe or an interpunct in case of my 2 examples.

I submitted a simple fix in PR #155. Basically it removes these characters from the first word before checking if the casing is correct. If these are not replaced, casing is undefined.

Please review. While linting works correctly for my items now, I haven't performed any tests on other lists to check the robustness of the new version.