diff --git a/.editorconfig b/.editorconfig index 4a22149..4be0557 100644 --- a/.editorconfig +++ b/.editorconfig @@ -6,11 +6,12 @@ root = true [*] charset = utf-8 indent_style = space -indent_size = 4 +indent_size = 2 end_of_line = lf insert_final_newline = true trim_trailing_whitespace = true -max_line_length = 72 -[*.{yaml,yml}] -indent_size = 2 +# Have a bit shorter line length for text docs +[*.{txt,md,qmd}] +max_line_length = 72 +indent_size = 4 diff --git a/.vscode/extensions.json b/.vscode/extensions.json index d753ee4..6f89206 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,16 +1,16 @@ { - // See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations. - // Extension identifier format: ${publisher}.${name}. Example: vscode.csharp - // List of extensions which should be recommended for users of this workspace. "recommendations": [ - "jebbs.plantuml", + "eamodio.gitlens", + "github.vscode-github-actions", + "redhat.vscode-yaml", "donjayamanne.githistory", "felipecaputo.git-project-manager", "GitHub.vscode-pull-request-github", - "quarto.quarto", - "streetsidesoftware.code-spell-checker", "vivaxy.vscode-conventional-commits", - "pshaddel.conventional-branch" + "quarto.quarto", + "pshaddel.conventional-branch", + "EditorConfig.EditorConfig", + "tekumara.typos-vscode", ], // List of extensions recommended by VS Code that should not be recommended for users of this workspace. "unwantedRecommendations": [] diff --git a/.vscode/json.code-snippets b/.vscode/json.code-snippets index 6cfd8a1..1f48a0f 100644 --- a/.vscode/json.code-snippets +++ b/.vscode/json.code-snippets @@ -1,13 +1,13 @@ { - // Place your snippets for Quarto here. - // Each snippet is defined under a snippet name and has a prefix, body and description. - // The prefix is what is used to trigger the snippet and the body will be expanded and inserted. + // Place your snippets for Quarto here. + // Each snippet is defined under a snippet name and has a prefix, body and description. + // The prefix is what is used to trigger the snippet and the body will be expanded and inserted. // Possible variables are: // - // - $1 and $2 for tab stops, - // - $0 for the final cursor position, and + // - $1 and $2 for tab stops, + // - $0 for the final cursor position, and // - ${1:label}, ${2:another} for placeholders - // + // // Placeholders with the same ids are connected. // // How to use the code snippets: @@ -31,21 +31,6 @@ ], "description": "Insert bash formatted text" }, - "Insert YAML header for blogs": { - "scope": "quarto,markdown", - "prefix": "post_yaml", - "body": [ - "---", - "title: \"\"", - "description: \"Our reasons for ...\"", - "author: \"\"", - "date: last-modified", - "categories:", - " ${0:Type 'category_keywords' to insert categories}", - "---" - ], - "description": "Insert YAML header for Quarto blog posts." - }, "Insert a hidden comment section": { "scope": "quarto,markdown", "prefix": "hidden", @@ -76,14 +61,6 @@ ], "description": "Insert a 3 col table" }, - "Insert video": { - "scope": "quarto,markdown", - "prefix": "video", - "body": [ - "{{< video ${0:Insert link here} >}}" - ], - "description": "Insert video that will be shown" - }, "Insert paneltab": { "scope": "quarto,markdown", "prefix": "paneltab", @@ -99,39 +76,5 @@ ":::" ], "description": "Insert paneltab (including two tabs here). If you want additional tabs, just include more headers." - }, - // All our category words are included in this code snippet - // The idea is that we can insert this section and then delete the words we aren't interested in - // If words are missing then they can be added to the document, and then also added to the code snippet - // Much the same way that words can be added to the spell-check extension. - "Insert list of category words": { - "scope": "quarto,markdown,yaml", - "prefix": "decision_categories", - "body": [ - "- backend", - "- code snippets", - "- communicate", - "- container", - "- contribute", - "- collaborate", - "- database", - "- deploy", - "- dependencies", - "- develop", - "- document", - "- front end", - "- framework", - "- git", - "- install", - "- license", - "- manage", - "- organize", - "- standardise", - "- style", - "- web", - "- workflow", - "- write" - ], - "description": "Insert list of category words" } } diff --git a/.vscode/settings.json b/.vscode/settings.json index 599fea3..fe29dae 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,27 +1,26 @@ { - "files.autoSave": "onFocusChange", - "editor.wordWrap": "on", + "files.autoSave": "onFocusChange", + "editor.wordWrap": "off", + "editor.formatOnSave": true, + "git.autofetch": false, + "quarto.visualEditor.markdownWrap": "column", + "quarto.visualEditor.markdownWrapColumn": 72, + "editor.tabCompletion": "on", + "editor.snippetSuggestions": "inline", + "conventional-branch.type": [ + "build", // Changes that affect the build system or external dependencies + "ci", // Changes to our CI configuration files and scripts + "docs", // Documentation only changes + "feat", // A new feature + "fix", // A bug fix + "refactor", // A code change that neither fixes a bug nor adds a feature + "style", // Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc) + "test", // Adding missing tests or correcting existing tests + "chore", // Misc things, like renaming or deleting files + ], + "conventional-branch.format": "{Type}/{Branch}", + "files.insertFinalNewline": true, + "[quarto,markdown]": { "editor.formatOnSave": false, - "git.autofetch": false, - "quarto.visualEditor.markdownWrap": "column", - "quarto.visualEditor.markdownWrapColumn": 72, - "editor.tabCompletion": "on", - "editor.snippetSuggestions": "inline", - "conventional-branch.type": [ - "build", // Changes that affect the build system or external dependencies - "ci", // Changes to our CI configuration files and scripts - "docs", // Documentation only changes - "feat", // A new feature - "fix", // A bug fix - "refactor", // A code change that neither fixes a bug nor adds a feature - "style", // Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc) - "test", // Adding missing tests or correcting existing tests - "chore", // Misc things, like renaming or deleting files - ], - "conventional-branch.format": "{Type}/{Branch}", - "files.insertFinalNewline": true, - "cSpell.enabledFileTypes": { - "quarto": true - }, - "cSpell.language": "en,en-GB", + }, } diff --git a/justfile b/justfile index c0f7c1d..cb615e0 100644 --- a/justfile +++ b/justfile @@ -1,13 +1,38 @@ @_default: just --list --unsorted -# Run all recipes -run-all: build-website +# Run all necessary build commands. +run-all: check-spelling check-commits build-website build-readme -# Generate PNG images from PlantUML files -generate-puml: - docker run --rm -v $(pwd):/puml -w /puml ghcr.io/plantuml/plantuml:latest -tsvg "**/*.puml" +# Install the pre-commit hooks +install-precommit: + # Install pre-commit hooks + uvx pre-commit install + # Run pre-commit hooks on all files + uvx pre-commit run --all-files + # Update versions of pre-commit hooks + uvx pre-commit autoupdate + +# Check spelling +check-spelling: + uvx typos + +# Run checks on all commits made on the current branch up to the main branch +check-commits: + #!/bin/zsh + branch_name=$(git rev-parse --abbrev-ref HEAD) + number_of_commits=$(git rev-list --count HEAD ^main) + if [[ ${branch_name} != "main" && ${number_of_commits} -gt 0 ]] + then + uvx --from commitizen cz check --rev-range main..HEAD + else + echo "Can't either be on ${branch_name} or have more than ${number_of_commits}." + fi # Build the website using Quarto build-website: quarto render + +# Re-build the README file +build-readme: + quarto render README.qmd --to gfm