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

Implement vale linter #147

Merged
merged 10 commits into from
Feb 13, 2024
Merged

Conversation

RCheesley
Copy link
Contributor

@RCheesley RCheesley commented Sep 8, 2023

Hi folks!

👋 Intro

This PR relates to #148 and implements the Vale linter to pick up spelling mistakes, grammar issues and potentially problematic word use.

I hope that this will help to iteratively improve the documentation and maintain quality going forward.

🤔 What's it doing?

Vale is a tool which lints - checks - text against certain pre-specified rules - much like similar tools for software development highlight and/or fix code style issues.

This helps to improve the quality of written text, pick up problems such as typos or grammar issues, and also can help to flag up words or phrases which might in some situations or cultures be inappropriate.

I have implemented two style plugins from Vale - Google and Alex.

Google's technical writers styleguide is a well-used developer technical style guide which covers a huge amount of grammar issues and best practices, and it also picks up some inappropriate word use.

Alex is more focused on the cultural sensitivity and appropriateness of words used.

This allows writers to check their text as they're writing (for example there are plugins for VSCode, PHPStorm etc) and it also allows us to check PRs which are made so that if we haven't fixed those files yet, they can be cleaned as we go and new contributions can be checked to ensure they adhere to the style guides.

✍️ Impact for writers

I have made one typo correction in a file and left another error in the same line, so that you can see what it looks like to the writer when they get feedback on their PR that something needs fixing:

screenshot-github com-2023 09 08-15_30_08

In this case, you could replace the word 'execute' with something else that is not going to flag up a warning for being potentially problematic, for example 'implement'.

🛟 Considerations

Some things that I have found from using Google's styleguide in particular in the Mautic docs is that it does promote writing in the active voice rather than passive voice for documentation which can be tricky even for native English speakers at times (but ChatGPT is great at helping to convert text from passive to active and there's various resources online to help, too). So it might do well to have some documentation for writers who want to contribute, explaining what your style guide, tone of voice etc is, and how to deal with feedback about improving the grammar.

It is also possible to add your own specific words, for example 'Decidim', so that it's not flagged up as a typo and is always written in its capitalised form. Likewise you can also have words which will also flag up a failure - eg if people commonly mis-spell something.

I hope that this is helpful, I'm planning to work through some of the errors that are thrown up with it and make a PR by section to fix them (but they can also be fixed iteratively over time, too - doesn't have to be addressed straight away), in addition to the PR which addresses the gendered terms.

@RCheesley RCheesley marked this pull request as ready for review September 8, 2023 14:49
@RCheesley RCheesley added documentation Improvements or additions to documentation enhancement New feature or request labels Sep 8, 2023
Copy link
Member

@andreslucena andreslucena left a comment

Choose a reason for hiding this comment

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

This is a great addition, specially for us that aren't English natives. We make lots of mistakes while writing, as you may've noticed 😅

I think that after we iron out the configuration for this (in a couple of months) we should also implement this on the main repository. I was thinking of at least the docs folder, as that includes some sections that are in https://docs.decidim.org

I have some suggestions before merging, can you please check them out? Thanks

.github/styles/Google/Contractions.yml Outdated Show resolved Hide resolved
.github/workflows/vale_linting.yml Outdated Show resolved Hide resolved
Co-authored-by: Andrés Pereira de Lucena <[email protected]>
@RCheesley
Copy link
Contributor Author

Hi folks, sorry for the delay. Unfortunately, I badly broke my arm, so the last week has been a fun time of hospitals, surgery, and recovery! Hoping to get back to this over the next couple of weeks.

@RCheesley
Copy link
Contributor Author

Ready for re-review - don't think the test failures relate to my changes.

This was referenced Dec 24, 2023
Copy link
Member

@andreslucena andreslucena left a comment

Choose a reason for hiding this comment

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

👍🏽

@andreslucena
Copy link
Member

Ignoring the failing check, as is unrelated to the current change set.

(Sorry for the delay with this one @RCheesley!!)

@andreslucena andreslucena merged commit 1405ff2 into decidim:develop Feb 13, 2024
5 of 6 checks passed
@RCheesley RCheesley mentioned this pull request Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Proposal: Implement Vale linter to catch typos, grammar issues and inappropriate word use
2 participants