-
Notifications
You must be signed in to change notification settings - Fork 0
Description
π€·ββοΈ Why
Linting, spell check, standard formatting. In may teams this is essentially what a lot of energy is wasted on during peer-reviews. Let's make it go aways, by setting up the environment right.
Even_before_ we've decided what language we will be programming in in this repo there are a handfull of tools we can install:
Caution
We will install the tools through the VS Code extensions, but that doesn't imply that they also work from scripting and tooling. This is awkward: I can do the right thin in. VS Code GUI, but I can not make a script or a workflow do the same?
Tip
Make it a habit when you use a linter or formatter tool; also install the equivalent CLI and make sure the both theVC Code Extension and the CLI use the same configuration...
π¬ Prompt
Setup cspell, markdownlint (markdownlint-cli2) and prettier so they work both
as VS Code extensions and as CLI tools, make sure that each tool in each variant
use the same configuration. For cspell also install and configure the Danish
dictionary and setup a repository wide dictionary. AND while you are add it,
also install my favorite extensions git-graph, better-git-line-blame and GitHub
Copilot (CLI too).
π οΈ D.I.Y.
Find and install the extensions in VS Code and then right-click it and chose "Add to Devcontainer..."
There's a bit of learning curve to get to install the corresponding CLIs and set the configuration up. Probably also why most team fall back to just continue their endless peer-reviews!
Your favorite GPT will be able to help you.
π€ Automation
.scripts/co-sample "Setup default linters" \
batch2 \
.cspell.jsonc \
.devcontainer/devcontainer.json \
.dict/repo.dictionary \
.markdownlint-cli2.jsonc \
.prettierignore \
.prettierrc \
.vscode/settings.jsonπ§ͺ Test
Try to run
cspell
markdownlint-cli2
prettier -c .All good!
OK, then go into README.md and in the button add a new line and write a rubbish word.
Immediately you will see 3 problems:
Cspell extension reports a misspelled word
Markdownlint requires an empty newline at the bottom.
Even Prettier is sad (same issue as Markdownlint)!
Before you fix them try to run the commands above again. Your CLI's are now able to verify the same thing.