diff --git a/.github/workflows/markdownlint.yml b/.github/workflows/markdownlint.yml deleted file mode 100644 index b8272424..00000000 --- a/.github/workflows/markdownlint.yml +++ /dev/null @@ -1,10 +0,0 @@ -name: markdownlint -on: [pull_request, push] -jobs: - mdl: - runs-on: ubuntu-latest - steps: - - name: Check out code - uses: actions/checkout@v2 - - name: Run mdl - uses: actionshub/markdownlint@main diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml new file mode 100644 index 00000000..700e7d8e --- /dev/null +++ b/.github/workflows/pre-commit.yml @@ -0,0 +1,28 @@ +name: pre-commit +on: [pull_request, push] +jobs: + pre-commit: + name: pre-commit checks + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 + + - name: Set up Python + uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6 + with: + python-version: "3.14" + + - name: Cache pre-commit environments + uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6 + with: + path: ~/.cache/pre-commit + key: pre-commit-${{ runner.os }}-${{ hashFiles('.pre-commit-config.yaml') }} + + - name: Install pre-commit + run: python -m pip install "pre-commit==4.6.1" + + - name: Run pre-commit + run: pre-commit run --all-files --show-diff-on-failure --color=always + diff --git a/.markdownlint.json b/.markdownlint.json new file mode 100644 index 00000000..680de0d8 --- /dev/null +++ b/.markdownlint.json @@ -0,0 +1,11 @@ +{ + "MD007": { "indent": 4 }, + "MD012": false, + "MD013": { "line_length": 999 }, + "MD032": false, + "MD033": false, + "MD034": false, + "MD041": false, + "MD045": false, + "MD060": false +} \ No newline at end of file diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..04779238 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,7 @@ +repos: + - repo: https://github.com/igorshubovych/markdownlint-cli + rev: v0.49.1 + hooks: + - id: markdownlint + - id: markdownlint-fix + \ No newline at end of file diff --git a/01_version_control/git_quiz.md b/01_version_control/git_quiz.md index 6e7fafb7..5ccd9327 100644 --- a/01_version_control/git_quiz.md +++ b/01_version_control/git_quiz.md @@ -29,7 +29,7 @@ cat motivation.txt - `Documenting major milestones.` - The following: -``` +```text Sharing information about myself. Documenting major milestones. ``` diff --git a/01_version_control/merge_rebase_slides.md b/01_version_control/merge_rebase_slides.md index 3f7ec237..1cc70a03 100644 --- a/01_version_control/merge_rebase_slides.md +++ b/01_version_control/merge_rebase_slides.md @@ -90,7 +90,7 @@ slideOptions: - `git log` - ``` + ```text 3e70cb5 8 seconds .. Merge branch 'feature' HEAD -> main 607a08a 18 seconds.. E feature 2e4f61f 28 seconds.. C diff --git a/01_version_control/my_favorite_neat_little_git_trick_demo.md b/01_version_control/my_favorite_neat_little_git_trick_demo.md index c7252a46..468a775f 100644 --- a/01_version_control/my_favorite_neat_little_git_trick_demo.md +++ b/01_version_control/my_favorite_neat_little_git_trick_demo.md @@ -10,7 +10,7 @@ - GitHub uses [gitignore templates](https://github.com/github/gitignore) if you create a `.gitignore` file from GitHub - To get a nice compact `git log`, you can add the following to your `gitconfig`: - ``` + ```rc [format] pretty = format:%C(auto,yellow)%h %C(auto,blue)%>(12,trunc)%ad %C(auto,green)%<(20,trunc)%aN%C(auto,reset)%s%C(auto,red)% gD% D ``` @@ -24,7 +24,7 @@ - Prefer `git add -p` over `git add [FILE]`. This allows you to specify what you want to add to a commit in a more fine-grained manner - A very nice alias for editing any earlier commit, without having to manually rebase: - ``` + ```rc [alias] amend = "!f() { \ COMMIT=$(git rev-parse --short \"$1\") && \ @@ -45,7 +45,7 @@ - GitHub uses [gitignore templates](https://github.com/github/gitignore) if you create a `.gitignore` file from GitHub - To get a nice compact `git log`, you can add the following to your `gitconfig`: - ``` + ```rc [format] pretty = format:%C(auto,yellow)%h %C(auto,blue)%>(12,trunc)%ad %C(auto,green)%<(20,trunc)%aN%C(auto,reset)%s%C(auto,red)% gD% D ``` @@ -76,7 +76,7 @@ - GitHub uses [gitignore templates](https://github.com/github/gitignore) if you create a `.gitignore` file from GitHub - To get a nice compact `git log`, you can add the following to your `gitconfig`: - ``` + ```rc [format] pretty = format:%C(auto,yellow)%h %C(auto,blue)%>(12,trunc)%ad %C(auto,green)%<(20,trunc)%aN%C(auto,reset)%s%C(auto,red)% gD% D ``` @@ -93,7 +93,7 @@ ### A helpful git config -``` +```rc [push] default = simple autoSetupRemote = true diff --git a/01_version_control/standards_slides.md b/01_version_control/standards_slides.md index 30538a3f..1ad078e8 100644 --- a/01_version_control/standards_slides.md +++ b/01_version_control/standards_slides.md @@ -73,12 +73,12 @@ Certain files lead to special formatting (normally directly at root of repo): ## Special Files (3) - `CITATION.cff` - - ... contains preferred citation details. - - ... gets rendered on the sidebar. - - ... export to BibTeX. + - ... contains preferred citation details. + - ... gets rendered on the sidebar. + - ... export to BibTeX. - `AGENTS.md` - - ... contains context and instructions for GenAI. - - ... more and more coding agents read it. + - ... contains context and instructions for GenAI. + - ... more and more coding agents read it. --- diff --git a/03_building_and_packaging/make_demo.md b/03_building_and_packaging/make_demo.md index fa3edf77..09728a51 100644 --- a/03_building_and_packaging/make_demo.md +++ b/03_building_and_packaging/make_demo.md @@ -43,6 +43,8 @@ int main() `Makefile`: + + ```makefile sse.o : sse/sse.hpp sse/sse.cpp $(CXX) -c sse/sse.cpp @@ -72,7 +74,7 @@ helloworld : main.cpp sse.o - `mkdir clean` and `make clean` confuses Make. - phony target (a helper target, doesn't correspond to a file) -``` +```makefile + .PHONY : all clean ``` diff --git a/04_documentation/examples/pandoc/example.md b/04_documentation/examples/pandoc/example.md index 9aaf0122..784da9d8 100644 --- a/04_documentation/examples/pandoc/example.md +++ b/04_documentation/examples/pandoc/example.md @@ -4,7 +4,7 @@ author: Firstname lastname date: 2026-01-07 --- -# Introduction +## Introduction This is text, **bold text**, *italic text*, and `inline code`. diff --git a/04_documentation/technical_writing_slides.md b/04_documentation/technical_writing_slides.md index ac39fcdc..526c334e 100644 --- a/04_documentation/technical_writing_slides.md +++ b/04_documentation/technical_writing_slides.md @@ -128,6 +128,8 @@ a community of technical writers. ## Documentation Content Should Be + + - **ARID** (*"Accept (some) Repetition in Documentation"*) - Not like good code (**DRY**: *"don't repeat yourself"*), but also not **WET** diff --git a/05_testing_and_ci/boost_testing_intro_slides.md b/05_testing_and_ci/boost_testing_intro_slides.md index 1386c79f..4f110b6c 100644 --- a/05_testing_and_ci/boost_testing_intro_slides.md +++ b/05_testing_and_ci/boost_testing_intro_slides.md @@ -65,7 +65,7 @@ If you know one, the next one is easy to learn. - [CppUnit](http://sourceforge.net/apps/mediawiki/cppunit/index.php?title=Main_Page) - [Cute](http://www.cute-test.com/) - [GoogleTest](http://code.google.com/p/googletest/) -- [More](https://en.wikipedia.org/wiki/List_of_unit_testing_frameworks#C.2B.2B) +- [More testing frameworks](https://en.wikipedia.org/wiki/List_of_unit_testing_frameworks#C.2B.2B) --- diff --git a/06_miscellaneous/floss_licenses_slides.md b/06_miscellaneous/floss_licenses_slides.md index 1dddc69e..38b12b49 100644 --- a/06_miscellaneous/floss_licenses_slides.md +++ b/06_miscellaneous/floss_licenses_slides.md @@ -111,7 +111,7 @@ Focus on big picture: There are mainly **three types**: ... so simple, we can actually read and mostly understand it: -``` +```text Copyright (c) [year] [fullname] Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/README.md b/README.md index 3fed8518..ad72565a 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Simulation Software Engineering Lecture Material -![markdownlint](https://github.com/Simulation-Software-Engineering/lecture-materials/actions/workflows/markdownlint.yml/badge.svg) +![pre-commit](https://github.com/Simulation-Software-Engineering/lecture-materials/actions/workflows/pre-commit.yml/badge.svg) [![PDFs](https://github.com/Simulation-Software-Engineering/lecture-materials/actions/workflows/create-pdfs-from-markdown.yml/badge.svg)](https://github.com/Simulation-Software-Engineering/Lecture-Material/actions/workflows/create-pdfs-from-markdown.yml) [![CC BY 4.0][cc-by-shield]][cc-by] @@ -22,10 +22,12 @@ Please note that we update the material over the course of each semester. ## Linting -The markdown files can be checked using [markdownlint](https://github.com/markdownlint/markdownlint/). Once the linter is installed, run it locally from the root of this repository using +The markdown files can be checked using [markdownlint](https://github.com/markdownlint/markdownlint/), which is automatically being called from [pre-commit](https://pre-commit.com/): -``` -mdl . +```shell +pipx install pre-commit # Install pre-commit as a tool +pre-commit install # Install/enable pre-commit in the specific repository +pre-commit run -a # Run all pre-commit hooks (not necessary, automatically when committing) ``` It will automatically read the markdownlint configuration of this repository. The linter is configured in the files `.mdl.rb` and `.mdlrc`. The majority of the configuration is done in `.mdl.rb`. diff --git a/docs/styleguide.md b/docs/styleguide.md index 84453f46..5b0feae8 100644 --- a/docs/styleguide.md +++ b/docs/styleguide.md @@ -61,6 +61,8 @@ Example: ## Links + + - Do not use [click here](https://www.smashingmagazine.com/2012/06/links-should-never-say-click-here/) links. ## Slides diff --git a/timetable.md b/timetable.md index e8c5a9e9..82ca69c9 100644 --- a/timetable.md +++ b/timetable.md @@ -1,5 +1,8 @@ # Timetable + + + | Week | Date | Type | Description | Lecturer | | --- | --- | --- | --- | --- | | [1](#week-1) | 14.10. | 🧑‍🏫 | Course intro, intro to SSE, VC basics | Gerasimos | @@ -26,9 +29,9 @@ | | | 🎉 | Student presentations: Challenge - step 2 | | | | | 🎉 | Student presentations: Challenge - step 2 | | | | | ⚠️ | **Deadline:** Suggest a Challenge contribution | | -| - | 23.12. | 🎄 | _Christmas break_ | | -| - | 30.12. | 🎄 | _Christmas break_ | | -| - | 06.01. | 🎄 | _Christmas break_ | | +| - | 23.12. | 🎄 | *Christmas break* | | +| - | 30.12. | 🎄 | *Christmas break* | | +| - | 06.01. | 🎄 | *Christmas break* | | | [11](#week-11) | 13.01. | 🧑‍🏫 | Intro testing, testing in Python | Felix | | | | 💻️ | Testing in Python | Felix | | [12](#week-12) | 20.01. | 🧑‍🏫 | Markup, Pandoc, website gener. | Felix |