From d37ab9ae85defa433805b69d0d25249708fef25b Mon Sep 17 00:00:00 2001 From: patritzenfeld Date: Tue, 19 Aug 2025 15:46:03 +0200 Subject: [PATCH 01/27] add haskell workflow --- .github/workflows/haskell.yml | 62 +++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 .github/workflows/haskell.yml diff --git a/.github/workflows/haskell.yml b/.github/workflows/haskell.yml new file mode 100644 index 0000000..5ee5467 --- /dev/null +++ b/.github/workflows/haskell.yml @@ -0,0 +1,62 @@ +--- +name: Haskell CI + +on: + push: + branches: ["main", "workflows"] + pull_request: + branches: ["main"] + +permissions: read-all + +jobs: + build_and_test: + strategy: + matrix: + os: + - ubuntu-latest + plan: + - {build: stack} + + runs-on: ${{ matrix.os }} + + steps: + - name: Install ${{ matrix.os }} Packages + uses: mstksg/get-package@v1 + with: + apt-get: ${{ matrix.apt-get }} + + - uses: actions/checkout@v4 + + - name: Cache Stack + id: cache-stack-unix + uses: actions/cache@v4 + with: + path: '**/.stack' + key: ${{ matrix.os }}-${{ matrix.plan.build }}-stack-home-${{ hashFiles('**/stack.yaml') }}-${{ hashFiles('**/package.yaml') }} + + - name: Setup stack + uses: haskell-actions/setup@v2 + with: + enable-stack: true + stack-no-global: true + + - name: Install dependencies + run: | + set -ex + stack --no-terminal --install-ghc build --test --bench --only-dependencies + cd raw/embedded + stack build --no-terminal --install-ghc build --test --bench --only-dependencies + set +ex + env: + BUILD: ${{ matrix.plan.build }} + + - name: Build and test + run: | + set -ex + stack --no-terminal test --coverage --bench --no-run-benchmarks --haddock --no-haddock-deps + cd raw/embedded + stack --no-terminal test --coverage --bench --no-run-benchmarks --haddock --no-haddock-deps + set +ex + env: + BUILD: ${{ matrix.plan.build }} From b9946d261f909d49e08f24e7c385c6839c17617e Mon Sep 17 00:00:00 2001 From: patritzenfeld Date: Tue, 19 Aug 2025 16:04:00 +0200 Subject: [PATCH 02/27] fix cache path --- .github/workflows/haskell.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/haskell.yml b/.github/workflows/haskell.yml index 5ee5467..a5c039a 100644 --- a/.github/workflows/haskell.yml +++ b/.github/workflows/haskell.yml @@ -32,7 +32,7 @@ jobs: id: cache-stack-unix uses: actions/cache@v4 with: - path: '**/.stack' + path: '~/.stack' key: ${{ matrix.os }}-${{ matrix.plan.build }}-stack-home-${{ hashFiles('**/stack.yaml') }}-${{ hashFiles('**/package.yaml') }} - name: Setup stack From 4f57e552f3ee62f02a88de22ebcf433d7affa92a Mon Sep 17 00:00:00 2001 From: patritzenfeld Date: Tue, 19 Aug 2025 16:28:42 +0200 Subject: [PATCH 03/27] add linters --- .github/workflows/haskell.yml | 4 ++-- .github/workflows/hlint.yml | 27 +++++++++++++++++++++++++++ .github/workflows/linter.yml | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 63 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/hlint.yml create mode 100644 .github/workflows/linter.yml diff --git a/.github/workflows/haskell.yml b/.github/workflows/haskell.yml index a5c039a..87a6648 100644 --- a/.github/workflows/haskell.yml +++ b/.github/workflows/haskell.yml @@ -3,9 +3,9 @@ name: Haskell CI on: push: - branches: ["main", "workflows"] + branches: ["master", "workflows"] pull_request: - branches: ["main"] + branches: ["master"] permissions: read-all diff --git a/.github/workflows/hlint.yml b/.github/workflows/hlint.yml new file mode 100644 index 0000000..f8ca2f2 --- /dev/null +++ b/.github/workflows/hlint.yml @@ -0,0 +1,27 @@ +--- +name: Haskell Linter + +on: + push: + branches: ["master", "workflows"] + pull_request: + branches: ["master"] + +permissions: read-all + +jobs: + run: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: 'Set up HLint' + uses: haskell-actions/hlint-setup@v2 + with: + version: '3.8' + + - name: 'Run HLint' + uses: haskell-actions/hlint-run@v2 + with: + path: '["src/", "raw/src/", "raw/embedded/src/"]' + fail-on: suggestion diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml new file mode 100644 index 0000000..93ca394 --- /dev/null +++ b/.github/workflows/linter.yml @@ -0,0 +1,34 @@ +--- +name: Super-Linter + +on: + push: + branches: ["master", "workflows"] + pull_request: + branches: ["master"] + +permissions: read-all + +jobs: + build: + name: Lint Code Base + runs-on: ubuntu-latest + + permissions: + contents: read + statuses: write + + steps: + - name: Checkout Code + uses: actions/checkout@v4 + with: + # Full git history is needed to get a proper + # list of changed files within `super-linter` + fetch-depth: 0 + + - name: Run Linter + uses: github/super-linter@v7 + env: + YAML_ERROR_ON_WARNING: true + GITHUB_ACTIONS_COMMAND_ARGS: -shellcheck= + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From a985e81b28334ff7b34014ef8bc4451ff6cb20c9 Mon Sep 17 00:00:00 2001 From: patritzenfeld Date: Tue, 19 Aug 2025 16:33:27 +0200 Subject: [PATCH 04/27] disable conflicting linter --- .github/workflows/linter.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 93ca394..18a1313 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -31,4 +31,5 @@ jobs: env: YAML_ERROR_ON_WARNING: true GITHUB_ACTIONS_COMMAND_ARGS: -shellcheck= + VALIDATE_YAML_PRETTIER: false GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 8b65428cbb82268e1a64a57b0ccd70115bc072eb Mon Sep 17 00:00:00 2001 From: patritzenfeld Date: Tue, 19 Aug 2025 16:35:38 +0200 Subject: [PATCH 05/27] add editorconfig file --- .editorconfig | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..ffbd1ce --- /dev/null +++ b/.editorconfig @@ -0,0 +1,17 @@ +root = true + +[*] +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true +indent_style = space +max_line_length = 120 + +[**.{yml,yaml,md}] +max_line_length = 160 + +[.github/actions/spelling/*] +max_line_length = unset + +[**.cabal] +max_line_length = unset From 8ff072e0574c0a5366f1c67f04c2469f788c5721 Mon Sep 17 00:00:00 2001 From: patritzenfeld Date: Tue, 19 Aug 2025 16:40:20 +0200 Subject: [PATCH 06/27] remove unnecessary build step --- .github/workflows/haskell.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/haskell.yml b/.github/workflows/haskell.yml index 87a6648..6442d9b 100644 --- a/.github/workflows/haskell.yml +++ b/.github/workflows/haskell.yml @@ -21,11 +21,6 @@ jobs: runs-on: ${{ matrix.os }} steps: - - name: Install ${{ matrix.os }} Packages - uses: mstksg/get-package@v1 - with: - apt-get: ${{ matrix.apt-get }} - - uses: actions/checkout@v4 - name: Cache Stack From c2238235dc9d37088998cff520551be710c0d957 Mon Sep 17 00:00:00 2001 From: patritzenfeld Date: Tue, 19 Aug 2025 16:49:53 +0200 Subject: [PATCH 07/27] add spell check --- .github/actions/spelling/README.md | 17 + .github/actions/spelling/advice.md | 22 + .github/actions/spelling/allow.txt | 17 + .github/actions/spelling/candidate.patterns | 527 ++++++++++++++++++ .github/actions/spelling/excludes.txt | 68 +++ .github/actions/spelling/expect.txt | 0 .../actions/spelling/line_forbidden.patterns | 59 ++ .github/actions/spelling/patterns.txt | 41 ++ .github/actions/spelling/reject.txt | 10 + .github/workflows/spelling.yml | 81 +++ 10 files changed, 842 insertions(+) create mode 100644 .github/actions/spelling/README.md create mode 100644 .github/actions/spelling/advice.md create mode 100644 .github/actions/spelling/allow.txt create mode 100644 .github/actions/spelling/candidate.patterns create mode 100644 .github/actions/spelling/excludes.txt create mode 100644 .github/actions/spelling/expect.txt create mode 100644 .github/actions/spelling/line_forbidden.patterns create mode 100644 .github/actions/spelling/patterns.txt create mode 100644 .github/actions/spelling/reject.txt create mode 100644 .github/workflows/spelling.yml diff --git a/.github/actions/spelling/README.md b/.github/actions/spelling/README.md new file mode 100644 index 0000000..cc187a5 --- /dev/null +++ b/.github/actions/spelling/README.md @@ -0,0 +1,17 @@ +# check-spelling/check-spelling configuration + +File | Purpose | Format | Info +-|-|-|- +dictionary.txt | Replacement dictionary (creating this file will override the default dictionary) | one word per line | [dictionary](https://github.com/check-spelling/check-spelling/wiki/Configuration#dictionary) +[allow.txt](allow.txt) | Add words to the dictionary | one word per line (only letters and `'`s allowed) | [allow](https://github.com/check-spelling/check-spelling/wiki/Configuration#allow) +[reject.txt](reject.txt) | Remove words from the dictionary (after allow) | grep pattern matching whole dictionary words | [reject](https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples%3A-reject) +[excludes.txt](excludes.txt) | Files to ignore entirely | perl regular expression | [excludes](https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples%3A-excludes) +only.txt | Only check matching files (applied after excludes) | perl regular expression | [only](https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples%3A-only) +[patterns.txt](patterns.txt) | Patterns to ignore from checked lines | perl regular expression (order matters, first match wins) | [patterns](https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples%3A-patterns) +[candidate.patterns](candidate.patterns) | Patterns that might be worth adding to [patterns.txt](patterns.txt) | perl regular expression with optional comment block introductions (all matches will be suggested) | [candidates](https://github.com/check-spelling/check-spelling/wiki/Feature:-Suggest-patterns) +[line_forbidden.patterns](line_forbidden.patterns) | Patterns to flag in checked lines | perl regular expression (order matters, first match wins) | [patterns](https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples%3A-patterns) +[expect.txt](expect.txt) | Expected words that aren't in the dictionary | one word per line (sorted, alphabetically) | [expect](https://github.com/check-spelling/check-spelling/wiki/Configuration#expect) +[advice.md](advice.md) | Supplement for GitHub comment when unrecognized words are found | GitHub Markdown | [advice](https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples%3A-advice) + +Note: you can replace any of these files with a directory by the same name (minus the suffix) +and then include multiple files inside that directory (with that suffix) to merge multiple files together. diff --git a/.github/actions/spelling/advice.md b/.github/actions/spelling/advice.md new file mode 100644 index 0000000..e5292bc --- /dev/null +++ b/.github/actions/spelling/advice.md @@ -0,0 +1,22 @@ + +
If the flagged items are false positives + +If items relate to a ... +* binary file (or some other file you wouldn't want to check at all). + + Please add a file path to the `excludes.txt` file matching the containing file. + + File paths are Perl 5 Regular Expressions - you can [test](https://www.regexplanet.com/advanced/perl) yours before committing to verify it will match your files. + + `^` refers to the file's path from the root of the repository, so `^README\.md$` would exclude README.md (on whichever branch you're using). + +* well-formed pattern. + + If you can write a [pattern](https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples:-patterns) that would match it, + try adding it to the `patterns.txt` file. + + Patterns are Perl 5 Regular Expressions - you can [test](https://www.regexplanet.com/advanced/perl) yours before committing to verify it will match your lines. + + Note that patterns can't match multiline strings. + +
diff --git a/.github/actions/spelling/allow.txt b/.github/actions/spelling/allow.txt new file mode 100644 index 0000000..d5705b9 --- /dev/null +++ b/.github/actions/spelling/allow.txt @@ -0,0 +1,17 @@ +autotool +Bifunctor +elems +fmap +fmidue +foldl +foldr +fst +ghc +GHC +ghci +github +Hspec +mempty +thd +unlines +yml diff --git a/.github/actions/spelling/candidate.patterns b/.github/actions/spelling/candidate.patterns new file mode 100644 index 0000000..340922d --- /dev/null +++ b/.github/actions/spelling/candidate.patterns @@ -0,0 +1,527 @@ +# marker to ignore all code on line +^.*/\* #no-spell-check-line \*/.*$ +# marker to ignore all code on line +^.*\bno-spell-check(?:-line|)(?:\s.*|)$ + +# https://cspell.org/configuration/document-settings/ +# cspell inline +^.*\b[Cc][Ss][Pp][Ee][Ll]{2}:\s*[Dd][Ii][Ss][Aa][Bb][Ll][Ee]-[Ll][Ii][Nn][Ee]\b + +# patch hunk comments +^\@\@ -\d+(?:,\d+|) \+\d+(?:,\d+|) \@\@ .* +# git index header +index (?:[0-9a-z]{7,40},|)[0-9a-z]{7,40}\.\.[0-9a-z]{7,40} + +# cid urls +(['"])cid:.*?\g{-1} + +# data url in parens +\(data:[^)]*?(?:[A-Z]{3,}|[A-Z][a-z]{2,}|[a-z]{3,})[^)]*\) +# data url in quotes +([`'"])data:.*?(?:[A-Z]{3,}|[A-Z][a-z]{2,}|[a-z]{3,}).*\g{-1} +# data url +data:[-a-zA-Z=;:/0-9+]*,\S* + +# https/http/file urls +(?:\b(?:https?|ftp|file)://)[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|] + +# mailto urls +mailto:[-a-zA-Z=;:/?%&0-9+@.]{3,} + +# magnet urls +magnet:[?=:\w]+ + +# magnet urls +"magnet:[^"]+" + +# obs: +"obs:[^"]*" + +# The `\b` here means a break, it's the fancy way to handle urls, but it makes things harder to read +# In this examples content, I'm using a number of different ways to match things to show various approaches +# asciinema +\basciinema\.org/a/[0-9a-zA-Z]+ + +# apple +\bdeveloper\.apple\.com/[-\w?=/]+ +# Apple music +\bembed\.music\.apple\.com/fr/playlist/usr-share/[-\w.]+ + +# appveyor api +\bci\.appveyor\.com/api/projects/status/[0-9a-z]+ +# appveyor project +\bci\.appveyor\.com/project/(?:[^/\s"]*/){2}builds?/\d+/job/[0-9a-z]+ + +# Amazon + +# Amazon +\bamazon\.com/[-\w]+/(?:dp/[0-9A-Z]+|) +# AWS S3 +\b\w*\.s3[^.]*\.amazonaws\.com/[-\w/&#%_?:=]* +# AWS execute-api +\b[0-9a-z]{10}\.execute-api\.[-0-9a-z]+\.amazonaws\.com\b +# AWS ELB +\b\w+\.[-0-9a-z]+\.elb\.amazonaws\.com\b +# AWS SNS +\bsns\.[-0-9a-z]+.amazonaws\.com/[-\w/&#%_?:=]* +# AWS VPC +vpc-\w+ + +# While you could try to match `http://` and `https://` by using `s?` in `https?://`, sometimes there +# YouTube url +\b(?:(?:www\.|)youtube\.com|youtu.be)/(?:channel/|embed/|user/|playlist\?list=|watch\?v=|v/|)[-a-zA-Z0-9?&=_%]* +# YouTube music +\bmusic\.youtube\.com/youtubei/v1/browse(?:[?&]\w+=[-a-zA-Z0-9?&=_]*) +# YouTube tag +<\s*youtube\s+id=['"][-a-zA-Z0-9?_]*['"] +# YouTube image +\bimg\.youtube\.com/vi/[-a-zA-Z0-9?&=_]* +# Google Accounts +\baccounts.google.com/[-_/?=.:;+%&0-9a-zA-Z]* +# Google Analytics +\bgoogle-analytics\.com/collect.[-0-9a-zA-Z?%=&_.~]* +# Google APIs +\bgoogleapis\.(?:com|dev)/[a-z]+/(?:v\d+/|)[a-z]+/[-@:./?=\w+|&]+ +# Google Storage +\b[-a-zA-Z0-9.]*\bstorage\d*\.googleapis\.com(?:/\S*|) +# Google Calendar +\bcalendar\.google\.com/calendar(?:/u/\d+|)/embed\?src=[@./?=\w&%]+ +\w+\@group\.calendar\.google\.com\b +# Google DataStudio +\bdatastudio\.google\.com/(?:(?:c/|)u/\d+/|)(?:embed/|)(?:open|reporting|datasources|s)/[-0-9a-zA-Z]+(?:/page/[-0-9a-zA-Z]+|) +# The leading `/` here is as opposed to the `\b` above +# ... a short way to match `https://` or `http://` since most urls have one of those prefixes +# Google Docs +/docs\.google\.com/[a-z]+/(?:ccc\?key=\w+|(?:u/\d+|d/(?:e/|)[0-9a-zA-Z_-]+/)?(?:edit\?[-\w=#.]*|/\?[\w=&]*|)) +# Google Drive +\bdrive\.google\.com/(?:file/d/|open)[-0-9a-zA-Z_?=]* +# Google Groups +\bgroups\.google\.com/(?:(?:forum/#!|d/)(?:msg|topics?|searchin)|a)/[^/\s"]+/[-a-zA-Z0-9$]+(?:/[-a-zA-Z0-9]+)* +# Google Maps +\bmaps\.google\.com/maps\?[\w&;=]* +# Google themes +themes\.googleusercontent\.com/static/fonts/[^/\s"]+/v\d+/[^.]+. +# Google CDN +\bclients2\.google(?:usercontent|)\.com[-0-9a-zA-Z/.]* +# Goo.gl +/goo\.gl/[a-zA-Z0-9]+ +# Google Chrome Store +\bchrome\.google\.com/webstore/detail/[-\w]*(?:/\w*|) +# Google Books +\bgoogle\.(?:\w{2,4})/books(?:/\w+)*\?[-\w\d=&#.]* +# Google Fonts +\bfonts\.(?:googleapis|gstatic)\.com/[-/?=:;+&0-9a-zA-Z]* +# Google Forms +\bforms\.gle/\w+ +# Google Scholar +\bscholar\.google\.com/citations\?user=[A-Za-z0-9_]+ +# Google Colab Research Drive +\bcolab\.research\.google\.com/drive/[-0-9a-zA-Z_?=]* + +# GitHub SHAs (api) +\bapi.github\.com/repos(?:/[^/\s"]+){3}/[0-9a-f]+\b +# GitHub SHAs (markdown) +(?:\[`?[0-9a-f]+`?\]\(https:/|)/(?:www\.|)github\.com(?:/[^/\s"]+){2,}(?:/[^/\s")]+)(?:[0-9a-f]+(?:[-0-9a-zA-Z/#.]*|)\b|) +# GitHub SHAs +\bgithub\.com(?:/[^/\s"]+){2}[@#][0-9a-f]+\b +# GitHub wiki +\bgithub\.com/(?:[^/]+/){2}wiki/(?:(?:[^/]+/|)_history|[^/]+(?:/_compare|)/[0-9a-f.]{40,})\b +# githubusercontent +/[-a-z0-9]+\.githubusercontent\.com/[-a-zA-Z0-9?&=_\/.]* +# githubassets +\bgithubassets.com/[0-9a-f]+(?:[-/\w.]+) +# gist github +\bgist\.github\.com/[^/\s"]+/[0-9a-f]+ +# git.io +\bgit\.io/[0-9a-zA-Z]+ +# GitHub JSON +"node_id": "[-a-zA-Z=;:/0-9+]*" +# Contributor +\[[^\]]+\]\(https://github\.com/[^/\s"]+\) +# GHSA +GHSA(?:-[0-9a-z]{4}){3} + +# GitLab commit +\bgitlab\.[^/\s"]*/\S+/\S+/commit/[0-9a-f]{7,16}#[0-9a-f]{40}\b +# GitLab merge requests +\bgitlab\.[^/\s"]*/\S+/\S+/-/merge_requests/\d+/diffs#[0-9a-f]{40}\b +# GitLab uploads +\bgitlab\.[^/\s"]*/uploads/[-a-zA-Z=;:/0-9+]* +# GitLab commits +\bgitlab\.[^/\s"]*/(?:[^/\s"]+/){2}commits?/[0-9a-f]+\b + +# binanace +accounts.binance.com/[a-z/]*oauth/authorize\?[-0-9a-zA-Z&%]* + +# bitbucket diff +\bapi\.bitbucket\.org/\d+\.\d+/repositories/(?:[^/\s"]+/){2}diff(?:stat|)(?:/[^/\s"]+){2}:[0-9a-f]+ +# bitbucket repositories commits +\bapi\.bitbucket\.org/\d+\.\d+/repositories/(?:[^/\s"]+/){2}commits?/[0-9a-f]+ +# bitbucket commits +\bbitbucket\.org/(?:[^/\s"]+/){2}commits?/[0-9a-f]+ + +# bit.ly +\bbit\.ly/\w+ + +# bitrise +\bapp\.bitrise\.io/app/[0-9a-f]*/[\w.?=&]* + +# bootstrapcdn.com +\bbootstrapcdn\.com/[-./\w]+ + +# cdn.cloudflare.com +\bcdnjs\.cloudflare\.com/[./\w]+ + +# circleci +\bcircleci\.com/gh(?:/[^/\s"]+){1,5}.[a-z]+\?[-0-9a-zA-Z=&]+ + +# gitter +\bgitter\.im(?:/[^/\s"]+){2}\?at=[0-9a-f]+ + +# gravatar +\bgravatar\.com/avatar/[0-9a-f]+ + +# ibm +[a-z.]*ibm\.com/[-_#=:%!?~.\\/\d\w]* + +# imgur +\bimgur\.com/[^.]+ + +# Internet Archive +\barchive\.org/web/\d+/(?:[-\w.?,'/\\+&%$#_:]*) + +# discord +/discord(?:app\.com|\.gg)/(?:invite/)?[a-zA-Z0-9]{7,} + +# Disqus +\bdisqus\.com/[-\w/%.()!?&=_]* + +# medium link +\blink\.medium\.com/[a-zA-Z0-9]+ +# medium +\bmedium\.com/\@?[^/\s"]+/[-\w]+ + +# microsoft +\b(?:https?://|)(?:(?:download\.visualstudio|docs|msdn2?|research)\.microsoft|blogs\.msdn)\.com/[-_a-zA-Z0-9()=./%]* +# powerbi +\bapp\.powerbi\.com/reportEmbed/[^"' ]* +# vs devops +\bvisualstudio.com(?::443|)/[-\w/?=%&.]* +# microsoft store +\bmicrosoft\.com/store/apps/\w+ + +# mvnrepository.com +\bmvnrepository\.com/[-0-9a-z./]+ + +# now.sh +/[0-9a-z-.]+\.now\.sh\b + +# oracle +\bdocs\.oracle\.com/[-0-9a-zA-Z./_?#&=]* + +# chromatic.com +/\S+.chromatic.com\S*[")] + +# codacy +\bapi\.codacy\.com/project/badge/Grade/[0-9a-f]+ + +# compai +\bcompai\.pub/v1/png/[0-9a-f]+ + +# mailgun api +\.api\.mailgun\.net/v3/domains/[0-9a-z]+\.mailgun.org/messages/[0-9a-zA-Z=@]* +# mailgun +\b[0-9a-z]+.mailgun.org + +# /message-id/ +/message-id/[-\w@./%]+ + +# Reddit +\breddit\.com/r/[/\w_]* + +# requestb.in +\brequestb\.in/[0-9a-z]+ + +# sched +\b[a-z0-9]+\.sched\.com\b + +# Slack url +slack://[a-zA-Z0-9?&=]+ +# Slack +\bslack\.com/[-0-9a-zA-Z/_~?&=.]* +# Slack edge +\bslack-edge\.com/[-a-zA-Z0-9?&=%./]+ +# Slack images +\bslack-imgs\.com/[-a-zA-Z0-9?&=%.]+ + +# shields.io +\bshields\.io/[-\w/%?=&.:+;,]* + +# stackexchange -- https://stackexchange.com/feeds/sites +\b(?:askubuntu|serverfault|stack(?:exchange|overflow)|superuser).com/(?:questions/\w+/[-\w]+|a/) + +# Sentry +[0-9a-f]{32}\@o\d+\.ingest\.sentry\.io\b + +# Twitter markdown +\[\@[^[/\]:]*?\]\(https://twitter.com/[^/\s"')]*(?:/status/\d+(?:\?[-_0-9a-zA-Z&=]*|)|)\) +# Twitter hashtag +\btwitter\.com/hashtag/[\w?_=&]* +# Twitter status +\btwitter\.com/[^/\s"')]*(?:/status/\d+(?:\?[-_0-9a-zA-Z&=]*|)|) +# Twitter profile images +\btwimg\.com/profile_images/[_\w./]* +# Twitter media +\btwimg\.com/media/[-_\w./?=]* +# Twitter link shortened +\bt\.co/\w+ + +# facebook +\bfburl\.com/[0-9a-z_]+ +# facebook CDN +\bfbcdn\.net/[\w/.,]* +# facebook watch +\bfb\.watch/[0-9A-Za-z]+ + +# dropbox +\bdropbox\.com/sh?/[^/\s"]+/[-0-9A-Za-z_.%?=&;]+ + +# ipfs protocol +ipfs://[0-9a-z]* +# ipfs url +/ipfs/[0-9a-z]* + +# w3 +\bw3\.org/[-0-9a-zA-Z/#.]+ + +# loom +\bloom\.com/embed/[0-9a-f]+ + +# regex101 +\bregex101\.com/r/[^/\s"]+/\d+ + +# figma +\bfigma\.com/file(?:/[0-9a-zA-Z]+/)+ + +# freecodecamp.org +\bfreecodecamp\.org/[-\w/.]+ + +# image.tmdb.org +\bimage\.tmdb\.org/[/\w.]+ + +# mermaid +\bmermaid\.ink/img/[-\w]+|\bmermaid-js\.github\.io/mermaid-live-editor/#/edit/[-\w]+ + +# Wikipedia +\ben\.wikipedia\.org/wiki/[-\w%.#]+ + +# gitweb +[^"\s]+/gitweb/\S+;h=[0-9a-f]+ + +# HyperKitty lists +/archives/list/[^@/]+\@[^/\s"]*/message/[^/\s"]*/ + +# lists +/thread\.html/[^"\s]+ + +# list-management +\blist-manage\.com/subscribe(?:[?&](?:u|id)=[0-9a-f]+)+ + +# kubectl.kubernetes.io/last-applied-configuration +"kubectl.kubernetes.io/last-applied-configuration": ".*" + +# pgp +\bgnupg\.net/pks/lookup[?&=0-9a-zA-Z]* + +# Spotify +\bopen\.spotify\.com/embed/playlist/\w+ + +# Mastodon +\bmastodon\.[-a-z.]*/(?:media/|\@)[?&=0-9a-zA-Z_]* + +# scastie +\bscastie\.scala-lang\.org/[^/]+/\w+ + +# images.unsplash.com +\bimages\.unsplash\.com/(?:(?:flagged|reserve)/|)[-\w./%?=%&.;]+ + +# pastebin +\bpastebin\.com/[\w/]+ + +# heroku +\b\w+\.heroku\.com/source/archive/\w+ + +# quip +\b\w+\.quip\.com/\w+(?:(?:#|/issues/)\w+)? + +# badgen.net +\bbadgen\.net/badge/[^")\]'\s]+ + +# statuspage.io +\w+\.statuspage\.io\b + +# media.giphy.com +\bmedia\.giphy\.com/media/[^/]+/[\w.?&=]+ + +# tinyurl +\btinyurl\.com/\w+ + +# getopts +\bgetopts\s+(?:"[^"]+"|'[^']+') + +# ANSI color codes +(?:\\(?:u00|x)1b|\x1b)\[\d+(?:;\d+|)m + +# URL escaped characters +\%[0-9A-F][A-F] +# IPv6 +\b(?:[0-9a-fA-F]{0,4}:){3,7}[0-9a-fA-F]{0,4}\b +# c99 hex digits (not the full format, just one I've seen) +0x[0-9a-fA-F](?:\.[0-9a-fA-F]*|)[pP] +# Punycode +\bxn--[-0-9a-z]+ +# sha +sha\d+:[0-9]*[a-f]{3,}[0-9a-f]* +# sha-... -- uses a fancy capture +(['"]|")[0-9a-f]{40,}\g{-1} +# hex runs +\b[0-9a-fA-F]{16,}\b +# hex in url queries +=[0-9a-fA-F]*?(?:[A-F]{3,}|[a-f]{3,})[0-9a-fA-F]*?& +# ssh +(?:ssh-\S+|-nistp256) [-a-zA-Z=;:/0-9+]{12,} + +# PGP +\b(?:[0-9A-F]{4} ){9}[0-9A-F]{4}\b +# GPG keys +\b(?:[0-9A-F]{4} ){5}(?: [0-9A-F]{4}){5}\b +# Well known gpg keys +.well-known/openpgpkey/[\w./]+ + +# uuid: +\b[0-9a-fA-F]{8}-(?:[0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}\b +# hex digits including css/html color classes: +(?:[\\0][xX]|\\u|[uU]\+|#x?|\%23)[0-9_a-fA-FgGrR]*?[a-fA-FgGrR]{2,}[0-9_a-fA-FgGrR]*(?:[uUlL]{0,3}|u\d+)\b +# integrity +integrity="sha\d+-[-a-zA-Z=;:/0-9+]{40,}" + +# https://www.gnu.org/software/groff/manual/groff.html +# man troff content +\\f[BCIPR] +# ' +\\\(aq + +# .desktop mime types +^MimeTypes?=.*$ +# .desktop localized entries +^[A-Z][a-z]+\[[a-z]+\]=.*$ +# Localized .desktop content +Name\[[^\]]+\]=.* + +# IServiceProvider +\bI(?=(?:[A-Z][a-z]{2,})+\b) + +# crypt +"\$2[ayb]\$.{56}" + +# scrypt / argon +\$(?:scrypt|argon\d+[di]*)\$\S+ + +# Input to GitHub JSON +content: "[-a-zA-Z=;:/0-9+]*=" + +# Python stringprefix / binaryprefix +# Note that there's a high false positive rate, remove the `?=` and search for the regex to see if the matches seem like reasonable strings +(?v# +(?:(?<=[A-Z]{2})V|(?<=[a-z]{2}|[A-Z]{2})v)\d+(?:\b|(?=[a-zA-Z_])) +# Compiler flags (Scala) +(?:^|[\t ,>"'`=(])-J-[DPWXY](?=[A-Z]{2,}|[A-Z][a-z]|[a-z]{2,}) +# Compiler flags +(?:^|[\t ,"'`=(])-[DPWXYLlf](?=[A-Z]{2,}|[A-Z][a-z]|[a-z]{2,}) +# Compiler flags (linker) +,-B +# curl arguments +\b(?:\\n|)curl(?:\s+-[a-zA-Z]{1,2}\b)*(?:\s+-[a-zA-Z]{3,})(?:\s+-[a-zA-Z]+)* +# set arguments +\bset(?:\s+-[abefimouxE]{1,2})*\s+-[abefimouxE]{3,}(?:\s+-[abefimouxE]+)* +# tar arguments +\b(?:\\n|)g?tar(?:\.exe|)(?:(?:\s+--[-a-zA-Z]+|\s+-[a-zA-Z]+|\s[ABGJMOPRSUWZacdfh-pr-xz]+\b)(?:=[^ ]*|))+ +# tput arguments -- https://man7.org/linux/man-pages/man5/terminfo.5.html -- technically they can be more than 5 chars long... +\btput\s+(?:(?:-[SV]|-T\s*\w+)\s+)*\w{3,5}\b +# macOS temp folders +/var/folders/\w\w/[+\w]+/(?:T|-Caches-)/ diff --git a/.github/actions/spelling/excludes.txt b/.github/actions/spelling/excludes.txt new file mode 100644 index 0000000..dc86085 --- /dev/null +++ b/.github/actions/spelling/excludes.txt @@ -0,0 +1,68 @@ +# See https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples:-excludes +(?:^|/)(?i)COPYRIGHT +(?:^|/)(?i)LICEN[CS]E +(?:^|/)3rdparty/ +(?:^|/)go\.sum$ +(?:^|/)package(?:-lock|)\.json$ +(?:^|/)pyproject.toml +(?:^|/)requirements(?:-dev|-doc|-test|)\.txt$ +(?:^|/)vendor/ +ignore$ +\.a$ +\.ai$ +\.avi$ +\.bmp$ +\.bz2$ +\.cabal$ +\.class$ +\.coveragerc$ +\.crt$ +\.dll$ +\.docx?$ +\.drawio$ +\.DS_Store$ +\.eot$ +\.exe$ +\.gif$ +\.git-blame-ignore-revs$ +\.gitattributes$ +\.graffle$ +\.gz$ +\.icns$ +\.ico$ +\.jar$ +\.jks$ +\.jpe?g$ +\.key$ +\.lib$ +\.lock$ +\.map$ +\.min\.. +\.mod$ +\.mp[34]$ +\.o$ +\.ocf$ +\.otf$ +\.pdf$ +\.pem$ +\.png$ +\.psd$ +\.pyc$ +\.pylintrc$ +\.s$ +\.svg$ +\.svgz?$ +\.tar$ +\.tiff?$ +\.ttf$ +\.wav$ +\.webm$ +\.webp$ +\.woff2?$ +\.xlsx?$ +\.yaml$ +\.yml$ +\.zip$ +^\.github/actions/spelling/ +^\.github/linters/ +^\Qtest/Spec.hs\E$ diff --git a/.github/actions/spelling/expect.txt b/.github/actions/spelling/expect.txt new file mode 100644 index 0000000..e69de29 diff --git a/.github/actions/spelling/line_forbidden.patterns b/.github/actions/spelling/line_forbidden.patterns new file mode 100644 index 0000000..bf7c45d --- /dev/null +++ b/.github/actions/spelling/line_forbidden.patterns @@ -0,0 +1,59 @@ +# reject `m_data` as there's a certain OS which has evil defines that break things if it's used elsewhere +# \bm_data\b + +# If you have a framework that uses `it()` for testing and `fit()` for debugging a specific test, +# you might not want to check in code where you were debugging w/ `fit()`, in which case, you might want +# to use this: +#\bfit\( + +# s.b. GitHub +\bGithub\b + +# s.b. GitLab +\bGitlab\b + +# s.b. Microsoft +\bMicroSoft\b + +# s.b. another +\ban[- ]other\b + +# s.b. greater than +\bgreater then\b + +# s.b. into +\sin to\s + +# s.b. opt-in +\sopt in\s + +# s.b. less than +\bless then\b + +# s.b. otherwise +\bother[- ]wise\b + +# s.b. nonexistent +\bnon existing\b +\b[Nn]o[nt][- ]existent\b + +# s.b. preexisting +[Pp]re[- ]existing + +# s.b. preempt +[Pp]re[- ]empt\b + +# s.b. preemptively +[Pp]re[- ]emptively + +# s.b. reentrancy +[Rr]e[- ]entrancy + +# s.b. reentrant +[Rr]e[- ]entrant + +# s.b. workaround(s) +\bwork[- ]arounds?\b + +# Reject duplicate words +\s([A-Z]{3,}|[A-Z][a-z]{2,}|[a-z]{3,})\s\g{-1}\s diff --git a/.github/actions/spelling/patterns.txt b/.github/actions/spelling/patterns.txt new file mode 100644 index 0000000..b7106d6 --- /dev/null +++ b/.github/actions/spelling/patterns.txt @@ -0,0 +1,41 @@ +# See https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples:-patterns + +# Questionably acceptable forms of `in to` +# Personally, I prefer `log into`, but people object +# https://www.tprteaching.com/log-into-log-in-to-login/ +\b[Ll]og in to\b + +# acceptable duplicates + +# ls directory listings +[-bcdlpsw](?:[-r][-w][-Ssx]){3}\s+\d+\s+\S+\s+\S+\s+\d+\s+ + +# C types and repeated CSS values +\s(center|div|inherit|long|LONG|none|normal|solid|thin|transparent|very)(?: \g{-1})+\s + +# go templates +\s(\w+)\s+\g{-1}\s+\`(?:graphql|json|yaml): + +# javadoc / .net +(?:[\\@](?:groupname|param)|(?:public|private)(?:\s+static|\s+readonly)*)\s+(\w+)\s+\g{-1}\s + +# Commit message -- Signed-off-by and friends +^\s*(?:(?:Based-on-patch|Co-authored|Helped|Mentored|Reported|Reviewed|Signed-off)-by|Thanks-to): (?:[^<]*<[^>]*>|[^<]*)\s*$ + +# Autogenerated revert commit message +^This reverts commit [0-9a-f]{40}\.$ + +# GitHub SHAs (markdown) +\bcommit: [0-9a-f]*\b + +# ignore long runs of a single character: +\b([A-Za-z])\g{-1}{3,}\b + +# GHC LANGUAGE extension, HLINT options etc. +\{-# .* #-\} + +# ignore urls +https?://[-+0-9a-zA-Z?&=_\/%.]* + +# marker to ignore all code on line +^.*-- no-spell-check$ diff --git a/.github/actions/spelling/reject.txt b/.github/actions/spelling/reject.txt new file mode 100644 index 0000000..b5a6d36 --- /dev/null +++ b/.github/actions/spelling/reject.txt @@ -0,0 +1,10 @@ +^attache$ +benefitting +occurences? +^dependan.* +^oer$ +Sorce +^[Ss]pae.* +^untill$ +^untilling$ +^wether.* diff --git a/.github/workflows/spelling.yml b/.github/workflows/spelling.yml new file mode 100644 index 0000000..3ea4982 --- /dev/null +++ b/.github/workflows/spelling.yml @@ -0,0 +1,81 @@ +--- +name: Check Spelling + +on: + push: + branches: ["master", "workflows"] + pull_request_target: + issue_comment: + types: [created] + +permissions: read-all + +jobs: + spelling: + name: Check Spelling + permissions: + contents: read + pull-requests: read + actions: read + outputs: + followup: ${{ steps.spelling.outputs.followup }} + runs-on: ubuntu-latest + if: "contains(github.event_name, 'pull_request') || github.event_name == 'push'" + concurrency: + group: spelling-${{ github.event.pull_request.number || github.ref }} + # note: If you use only_check_changed_files, you do not want cancel-in-progress + cancel-in-progress: true + steps: + - name: check-spelling + id: spelling + uses: check-spelling/check-spelling@v0.0.25 + with: + suppress_push_for_open_pull_request: 1 + checkout: true + spell_check_this: check-spelling/spell-check-this@v0.0.25 + post_comment: 0 + experimental_apply_changes_via_bot: 1 + extra_dictionaries: + cspell:aws/aws.txt + cspell:haskell/dict/haskell.txt + cspell:software-terms/dict/softwareTerms.txt + cspell:filetypes/filetypes.txt + + comment: + name: Report + runs-on: ubuntu-latest + needs: spelling + permissions: + contents: write + pull-requests: write + if: (success() || failure()) && needs.spelling.outputs.followup + steps: + - name: comment + uses: check-spelling/check-spelling@v0.0.25 + with: + checkout: true + spell_check_this: check-spelling/spell-check-this@v0.0.25 + task: ${{ needs.spelling.outputs.followup }} + experimental_apply_changes_via_bot: 1 + + update: + name: Update PR + permissions: + contents: write + pull-requests: write + runs-on: ubuntu-latest + if: ${{ + github.event_name == 'issue_comment' && + github.event.issue.pull_request && + contains(github.event.comment.body, '@check-spelling-bot apply') + }} + concurrency: + group: spelling-update-${{ github.event.issue.number }} + cancel-in-progress: false + steps: + - name: apply spelling updates + uses: check-spelling/check-spelling@v0.0.25 + with: + experimental_apply_changes_via_bot: 1 + checkout: true + ssh_key: "${{ secrets.CHECK_SPELLING }}" From 56981bdb1cfb84d656f6a8c16bf4d8f4adb2e6a9 Mon Sep 17 00:00:00 2001 From: patritzenfeld Date: Tue, 19 Aug 2025 17:01:00 +0200 Subject: [PATCH 08/27] populate allow and expect --- .github/actions/spelling/allow.txt | 8 ++++++++ .github/actions/spelling/expect.txt | 12 ++++++++++++ 2 files changed, 20 insertions(+) diff --git a/.github/actions/spelling/allow.txt b/.github/actions/spelling/allow.txt index d5705b9..94a704c 100644 --- a/.github/actions/spelling/allow.txt +++ b/.github/actions/spelling/allow.txt @@ -1,5 +1,6 @@ autotool Bifunctor +concat elems fmap fmidue @@ -10,8 +11,15 @@ ghc GHC ghci github +hlint Hspec +HUnit mempty +mplus +msum +mzero +snd thd +uncurry unlines yml diff --git a/.github/actions/spelling/expect.txt b/.github/actions/spelling/expect.txt index e69de29..edc2b37 100644 --- a/.github/actions/spelling/expect.txt +++ b/.github/actions/spelling/expect.txt @@ -0,0 +1,12 @@ +deepseq +Felgenhauer +gfoldl +gmap +IOrep +Leijen +lhs +listify +quickcheck +rhs +vcat +werror From 9fe0b327d4848f1ecd57e0948468961ce75b7f68 Mon Sep 17 00:00:00 2001 From: patritzenfeld Date: Tue, 19 Aug 2025 17:11:45 +0200 Subject: [PATCH 09/27] add more words to spell check lists --- .github/actions/spelling/allow.txt | 1 + .github/actions/spelling/expect.txt | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/.github/actions/spelling/allow.txt b/.github/actions/spelling/allow.txt index 94a704c..157728f 100644 --- a/.github/actions/spelling/allow.txt +++ b/.github/actions/spelling/allow.txt @@ -2,6 +2,7 @@ autotool Bifunctor concat elems +finalise fmap fmidue foldl diff --git a/.github/actions/spelling/expect.txt b/.github/actions/spelling/expect.txt index edc2b37..5616d1a 100644 --- a/.github/actions/spelling/expect.txt +++ b/.github/actions/spelling/expect.txt @@ -1,12 +1,17 @@ deepseq Felgenhauer +FSolution gfoldl gmap IOrep +NPlusKPatterns Leijen lhs listify +Programmierung +PVar quickcheck rhs +testables vcat werror From 6828f5b90853c358e0b01982852b04f6bf47b703 Mon Sep 17 00:00:00 2001 From: patritzenfeld Date: Tue, 19 Aug 2025 17:17:14 +0200 Subject: [PATCH 10/27] more additions to the lists --- .github/actions/spelling/expect.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/actions/spelling/expect.txt b/.github/actions/spelling/expect.txt index 5616d1a..d2c53fe 100644 --- a/.github/actions/spelling/expect.txt +++ b/.github/actions/spelling/expect.txt @@ -1,17 +1,21 @@ +ekat deepseq Felgenhauer FSolution gfoldl gmap IOrep -NPlusKPatterns +KPatterns Leijen lhs listify +NPlus +perkid Programmierung PVar quickcheck rhs +ssi testables vcat werror From f961f2dcfa6b6d5dee5013d366fd1ef7bde67f1c Mon Sep 17 00:00:00 2001 From: patritzenfeld Date: Tue, 19 Aug 2025 17:21:00 +0200 Subject: [PATCH 11/27] fix typos --- .github/actions/spelling/expect.txt | 1 + raw/embedded/src/TestHelper.hs | 4 ++-- src/Haskell/Template/Match.hs | 2 +- src/Haskell/Template/Task.hs | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/actions/spelling/expect.txt b/.github/actions/spelling/expect.txt index d2c53fe..d4e17de 100644 --- a/.github/actions/spelling/expect.txt +++ b/.github/actions/spelling/expect.txt @@ -1,4 +1,5 @@ ekat +exts deepseq Felgenhauer FSolution diff --git a/raw/embedded/src/TestHelper.hs b/raw/embedded/src/TestHelper.hs index 2505e42..4679d72 100644 --- a/raw/embedded/src/TestHelper.hs +++ b/raw/embedded/src/TestHelper.hs @@ -69,7 +69,7 @@ mustFail x msg = monadicIO $ run $ do resultOrError <- try (evaluate x) case resultOrError of - Left (_::SomeException) -> return () -- expected failure occured. + Left (_::SomeException) -> return () -- expected failure occurred. Right _ -> error msg isDeeplyDefined :: NFData a => a -> IO Bool @@ -90,7 +90,7 @@ tcWithTimeoutAndArgs :: Int -> IOTasks.Args -> IOrep () -> Specification -> Asse tcWithTimeoutAndArgs to args prog spec = tcCustomizedWithTimeoutAndArgs to args prog spec id tcCustomizedWithTimeoutAndArgs :: Int -> IOTasks.Args -> IOrep () -> Specification -> (String -> String) -> Assertion -tcCustomizedWithTimeoutAndArgs to args prog spec transfom = tcTimeoutAndArgsHandleFailure to args prog spec (transfom . defaultErrorMessage args) +tcCustomizedWithTimeoutAndArgs to args prog spec transform = tcTimeoutAndArgsHandleFailure to args prog spec (transform . defaultErrorMessage args) tcWithInputsOnFailure :: Int -> IOTasks.Args -> IOrep () -> Specification -> ([String] -> String) -> Assertion tcWithInputsOnFailure to args prog spec withInputs = tcTimeoutAndArgsHandleFailure to args prog spec handleFailure diff --git a/src/Haskell/Template/Match.hs b/src/Haskell/Template/Match.hs index bb4c20e..770d950 100644 --- a/src/Haskell/Template/Match.hs +++ b/src/Haskell/Template/Match.hs @@ -171,7 +171,7 @@ matchUndef _ = False {-| Stores src span locations in state. -In conrast to 'matchSrcSpanInfo' it checks also arguments of constructors for +In contrast to 'matchSrcSpanInfo' it checks also arguments of constructors for existing 'S.SrcSpanInfo'. (uses 'matchSrcSpanInfo') -} diff --git a/src/Haskell/Template/Task.hs b/src/Haskell/Template/Task.hs index d25ed79..d97acb2 100644 --- a/src/Haskell/Template/Task.hs +++ b/src/Haskell/Template/Task.hs @@ -714,4 +714,4 @@ withNames exts mods = moduleName :: E.Module l -> String moduleName (E.Module _ (Just (E.ModuleHead _ (E.ModuleName _ n) _ _)) _ _ _) = n moduleName (E.Module _ Nothing _ _ _) = "Main" -moduleName _ = error "unsopported module type" +moduleName _ = error "unsupported module type" From b71b9cdc9d5d5f4118b9a8bd10a800e7fc2da320 Mon Sep 17 00:00:00 2001 From: patritzenfeld Date: Tue, 19 Aug 2025 17:33:20 +0200 Subject: [PATCH 12/27] rename bindings for spellchecker --- src/Haskell/Template/Task.hs | 20 ++++++++++---------- test/Haskell/Template/MatchSpec.hs | 6 +++--- test/Haskell/Template/TaskSpec.hs | 4 ++-- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/Haskell/Template/Task.hs b/src/Haskell/Template/Task.hs index d97acb2..0d3688e 100644 --- a/src/Haskell/Template/Task.hs +++ b/src/Haskell/Template/Task.hs @@ -380,8 +380,8 @@ grade eval reject inform tmp task submission = ((moduleName', template), others) <- nameModules (reject . string) exts rawModules files <- liftIO $ ((moduleName', submission) : others) - `forM` \(mname, contents) -> do - let fname = dirname mname <.> "hs" + `forM` \(mName, contents) -> do + let fname = dirname mName <.> "hs" strictWriteFile fname contents return fname let existingModules = map takeBaseName @@ -519,9 +519,9 @@ matchTemplate -> String -> m () matchTemplate reject config context exts template submission = do - mtemplate <- parse reject exts template - msubmission <- parse reject exts submission - case test mtemplate msubmission of + mTemplate <- parse reject exts template + mSubmission <- parse reject exts submission + case test mTemplate mSubmission of Fail loc -> mapM_ (rejectMatch rejectWithHint config context template submission) loc where rejectWithHint = reject . vcat . (: singleton rejectHint) @@ -604,9 +604,9 @@ parse parse reject' exts' m = case E.readExtensions m of Nothing -> reject' "cannot parse LANGUAGE pragmas at top of file" Just (_, exts) -> - let pamo = P.defaultParseMode - { P.extensions = exts ++ exts' } - in case P.parseModuleWithMode pamo m of + let parseMode = P.defaultParseMode + { P.extensions = exts ++ exts' } + in case P.parseModuleWithMode parseMode m of P.ParseOk a -> return a P.ParseFailed loc msg -> rejectParse reject' m loc msg @@ -689,9 +689,9 @@ splitBy p = dropOdd . groupBy (\l r -> not (p l) && not (p r)) unsafeTemplateSegment :: String -> String unsafeTemplateSegment task = either id id $ do - let Just (mconfig, modules) = + let Just (mConfig, modules) = splitConfigAndModules (const $ Just (defaultSolutionConfig, [])) task - exts = maybe [] extensionsOf $ addDefaults (const Nothing) mconfig + exts = maybe [] extensionsOf $ addDefaults (const Nothing) mConfig snd . fst <$> nameModules Left exts modules nameModules diff --git a/test/Haskell/Template/MatchSpec.hs b/test/Haskell/Template/MatchSpec.hs index 2fa1327..810e9a9 100644 --- a/test/Haskell/Template/MatchSpec.hs +++ b/test/Haskell/Template/MatchSpec.hs @@ -133,9 +133,9 @@ getComment -> String -> Either String [MatchKind [String]] getComment config template submission = do - mtemplate <- parse errorP [] template - msubmission <- parse errorP [] submission - case test mtemplate msubmission of + mTemplate <- parse errorP [] template + mSubmission <- parse errorP [] submission + case test mTemplate mSubmission of Fail loc -> let state = sequence $ rejectMatch storeP config 0 template submission <$> loc diff --git a/test/Haskell/Template/TaskSpec.hs b/test/Haskell/Template/TaskSpec.hs index 04a07ea..80d5c51 100644 --- a/test/Haskell/Template/TaskSpec.hs +++ b/test/Haskell/Template/TaskSpec.hs @@ -128,8 +128,8 @@ spec = do test :: [Test] test = [ "'r' does #{negateString}use 'reverse'?" ~: - syntaxCheck $ \\modul -> - contains (ident "reverse") (findTopLevelDeclsOf "r" modul) @?= #{withReverse} + syntaxCheck $ \\code -> + contains (ident "reverse") (findTopLevelDeclsOf "r" code) @?= #{withReverse} ] |] where From c0509470c1991b9f44f3df4f114bc7cf454a8ec2 Mon Sep 17 00:00:00 2001 From: patritzenfeld Date: Tue, 19 Aug 2025 17:37:47 +0200 Subject: [PATCH 13/27] rename more bindings --- src/Haskell/Template/Task.hs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Haskell/Template/Task.hs b/src/Haskell/Template/Task.hs index 0d3688e..28c357f 100644 --- a/src/Haskell/Template/Task.hs +++ b/src/Haskell/Template/Task.hs @@ -315,9 +315,9 @@ check reject inform i = do $ reject "wants to use System.IO.Unsafe" when ("unsafePerformIO" `isInfixOf` i) $ reject "wants to use unsafePerformIO" - (mconfig, modules) <- splitConfigAndModules reject i - inform $ string $ "Parsed the following setting options:\n" ++ show mconfig - config <- addDefaults reject mconfig + (mConfig, modules) <- splitConfigAndModules reject i + inform $ string $ "Parsed the following setting options:\n" ++ show mConfig + config <- addDefaults reject mConfig inform $ string $ "Completed configuration to:\n" ++ show config let exts = extensionsOf config ((m,s), ms) <- nameModules (reject . string) exts modules @@ -374,8 +374,8 @@ grade eval reject inform tmp task submission = $ void $ reject "wants to use System.IO.Unsafe" when ("unsafePerformIO" `isInfixOf` submission) $ void $ reject "wants to use unsafePerformIO" - (mconfig, rawModules) <- splitConfigAndModules reject task - config <- addDefaults reject mconfig + (mConfig, rawModules) <- splitConfigAndModules reject task + config <- addDefaults reject mConfig let exts = extensionsOf config ((moduleName', template), others) <- nameModules (reject . string) exts rawModules @@ -613,12 +613,12 @@ parse reject' exts' m = case E.readExtensions m of rejectParse :: (Doc -> t) -> String -> E.SrcLoc -> String -> t rejectParse reject' m loc msg = - let (lpre, _) = splitAt (E.srcLine loc) $ lines m - lpre' = takeEnd 3 lpre + let (lPre, _) = splitAt (E.srcLine loc) $ lines m + lPre' = takeEnd 3 lPre tag = replicate (E.srcColumn loc - 1) '.' ++ "^" in reject' $ vcat ["Syntax error (your solution is no Haskell program):", - bloc $ lpre' ++ [tag], + bloc $ lPre' ++ [tag], string msg] rejectMatch From 4c3602c7c5dacf0bedb28a800b16f2dada6b6d37 Mon Sep 17 00:00:00 2001 From: patritzenfeld Date: Tue, 19 Aug 2025 17:42:34 +0200 Subject: [PATCH 14/27] remove redundant dollar --- src/Haskell/Template/Match.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Haskell/Template/Match.hs b/src/Haskell/Template/Match.hs index 770d950..3a4d09d 100644 --- a/src/Haskell/Template/Match.hs +++ b/src/Haskell/Template/Match.hs @@ -53,7 +53,7 @@ instance Monad M where case a' of Ok a'' -> runM (b a'') Fail loc -> return $ Fail loc - Continue -> return $ Continue + Continue -> return Continue instance Functor M where fmap = liftM From 854e6e27d73ed2986e60b03a2631be7732d30066 Mon Sep 17 00:00:00 2001 From: patritzenfeld Date: Tue, 19 Aug 2025 17:45:44 +0200 Subject: [PATCH 15/27] disable another linter --- .github/workflows/linter.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 18a1313..f00e7d8 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -31,5 +31,6 @@ jobs: env: YAML_ERROR_ON_WARNING: true GITHUB_ACTIONS_COMMAND_ARGS: -shellcheck= + VALIDATE_MMARKDOWN_PRETTIER: false VALIDATE_YAML_PRETTIER: false GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 4729a5d026c9418e1d608c0d6f2e2f8a874066f3 Mon Sep 17 00:00:00 2001 From: patritzenfeld Date: Tue, 19 Aug 2025 17:45:57 +0200 Subject: [PATCH 16/27] fix typos in README --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e9959b2..e6c5c04 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ exports a function named `test`. ## Issues & Pull requests -If you required further explanations on the task type or or having issues with +If you require further explanations on the task type or are having issues with the task type please file an issue. -Improvements and bug fixes should be shared by filing a pull request. +Improvements and bugfixes should be shared by filing a pull request. From f455562d8848891f5a1a65ac6d216fdc6a75f6d0 Mon Sep 17 00:00:00 2001 From: patritzenfeld Date: Tue, 19 Aug 2025 17:47:23 +0200 Subject: [PATCH 17/27] remove running workflows on debugging branch --- .github/workflows/haskell.yml | 2 +- .github/workflows/hlint.yml | 2 +- .github/workflows/linter.yml | 2 +- .github/workflows/spelling.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/haskell.yml b/.github/workflows/haskell.yml index 6442d9b..8d32ddd 100644 --- a/.github/workflows/haskell.yml +++ b/.github/workflows/haskell.yml @@ -3,7 +3,7 @@ name: Haskell CI on: push: - branches: ["master", "workflows"] + branches: ["master"] pull_request: branches: ["master"] diff --git a/.github/workflows/hlint.yml b/.github/workflows/hlint.yml index f8ca2f2..c37d63e 100644 --- a/.github/workflows/hlint.yml +++ b/.github/workflows/hlint.yml @@ -3,7 +3,7 @@ name: Haskell Linter on: push: - branches: ["master", "workflows"] + branches: ["master"] pull_request: branches: ["master"] diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index f00e7d8..6b92d9c 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -3,7 +3,7 @@ name: Super-Linter on: push: - branches: ["master", "workflows"] + branches: ["master"] pull_request: branches: ["master"] diff --git a/.github/workflows/spelling.yml b/.github/workflows/spelling.yml index 3ea4982..348b69a 100644 --- a/.github/workflows/spelling.yml +++ b/.github/workflows/spelling.yml @@ -3,7 +3,7 @@ name: Check Spelling on: push: - branches: ["master", "workflows"] + branches: ["master"] pull_request_target: issue_comment: types: [created] From 77b1d28e8bbc2a55acf955dcf3d6bd70ee50536a Mon Sep 17 00:00:00 2001 From: patritzenfeld Date: Wed, 28 Jan 2026 13:07:21 +0100 Subject: [PATCH 18/27] apply/ignore hlint hints --- src/Haskell/Template/Match.hs | 4 ++++ test/Haskell/Template/MatchSpec.hs | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Haskell/Template/Match.hs b/src/Haskell/Template/Match.hs index 3a4d09d..4cf0b07 100644 --- a/src/Haskell/Template/Match.hs +++ b/src/Haskell/Template/Match.hs @@ -1,5 +1,9 @@ -- Based on a version of -- (c) Bertram Felgenhauer, 2011 + +{- HLINT ignore "Avoid lambda" -} +{- HLINT ignore "Use camelCase" -} + {-# LANGUAGE CPP #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE ScopedTypeVariables #-} diff --git a/test/Haskell/Template/MatchSpec.hs b/test/Haskell/Template/MatchSpec.hs index 810e9a9..b018c9f 100644 --- a/test/Haskell/Template/MatchSpec.hs +++ b/test/Haskell/Template/MatchSpec.hs @@ -137,8 +137,8 @@ getComment config template submission = do mSubmission <- parse errorP [] submission case test mTemplate mSubmission of Fail loc -> - let state = sequence - $ rejectMatch storeP config 0 template submission <$> loc + let state = mapM + (rejectMatch storeP config 0 template submission) loc in Right $ kindOfMatch <$> retrieve state Ok _ -> Right [] Continue -> Left "This should never happen" From 0d09335227e98ccee779d57f3672144d0dca65ed Mon Sep 17 00:00:00 2001 From: patritzenfeld Date: Wed, 28 Jan 2026 13:15:14 +0100 Subject: [PATCH 19/27] shorten long lines --- raw/embedded/src/TestHarness.hs | 2 +- raw/embedded/src/TestHelper.hs | 14 +++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/raw/embedded/src/TestHarness.hs b/raw/embedded/src/TestHarness.hs index 6f0f995..9959abd 100644 --- a/raw/embedded/src/TestHarness.hs +++ b/raw/embedded/src/TestHarness.hs @@ -104,7 +104,7 @@ allowFailures limit testCases = do ] where collectResults = fmap (groupIntoTwoLists . concat) - . mapM (\(l, action) -> either (\(e :: SomeException) -> [(l,Just e)]) (const [(l,Nothing)]) <$> try action) + . mapM (\(l, action) -> either (\(e :: SomeException) -> [(l,Just e)]) (const [(l,Nothing)]) <$> try action) groupIntoTwoLists :: [(a,Maybe b)] -> ([a],[(a,b)]) groupIntoTwoLists = foldr (\(a,mb) (ns,js) -> maybe (a:ns,js) (\b -> (ns,(a,b):js)) mb) ([],[]) diff --git a/raw/embedded/src/TestHelper.hs b/raw/embedded/src/TestHelper.hs index 4679d72..b56b8ee 100644 --- a/raw/embedded/src/TestHelper.hs +++ b/raw/embedded/src/TestHelper.hs @@ -90,7 +90,8 @@ tcWithTimeoutAndArgs :: Int -> IOTasks.Args -> IOrep () -> Specification -> Asse tcWithTimeoutAndArgs to args prog spec = tcCustomizedWithTimeoutAndArgs to args prog spec id tcCustomizedWithTimeoutAndArgs :: Int -> IOTasks.Args -> IOrep () -> Specification -> (String -> String) -> Assertion -tcCustomizedWithTimeoutAndArgs to args prog spec transform = tcTimeoutAndArgsHandleFailure to args prog spec (transform . defaultErrorMessage args) +tcCustomizedWithTimeoutAndArgs to args prog spec transform = + tcTimeoutAndArgsHandleFailure to args prog spec (transform . defaultErrorMessage args) tcWithInputsOnFailure :: Int -> IOTasks.Args -> IOrep () -> Specification -> ([String] -> String) -> Assertion tcWithInputsOnFailure to args prog spec withInputs = tcTimeoutAndArgsHandleFailure to args prog spec handleFailure @@ -101,11 +102,18 @@ tcWithInputsOnFailure to args prog spec withInputs = tcTimeoutAndArgsHandleFail defaultErrorMessage :: IOTasks.Args -> IOTasks.Outcome -> String defaultErrorMessage args = show . printOutcomeWith (feedbackStyle args) -tcTimeoutAndArgsHandleFailure :: Int -> IOTasks.Args -> IOrep () -> Specification -> (IOTasks.Outcome -> String) -> Assertion +tcTimeoutAndArgsHandleFailure + :: Int + -> IOTasks.Args + -> IOrep () + -> Specification + -> (IOTasks.Outcome -> String) + -> Assertion tcTimeoutAndArgsHandleFailure to args prog spec withFailure = do outcome <- System.timeout to $ taskCheckWithOutcome args{ terminalOutput = False } prog spec case outcome of Just (IOTasks.Outcome IOTasks.Success{} _) -> return () - Just (IOTasks.Outcome IOTasks.GaveUp _) -> assertFailure "Gave up on testing. This is usually not caused by a fault within your solution. Please contact your lecturers" + Just (IOTasks.Outcome IOTasks.GaveUp _) -> assertFailure + "Gave up on testing. This is usually not caused by a fault within your solution. Please contact your lecturers" Just o@(IOTasks.Outcome IOTasks.Failure{} _) -> assertFailure $ withFailure o Nothing -> assertFailure "Failure: Timeout" From 13a6ed6b5cf77ab2c0c490d2cdd93b7559f19621 Mon Sep 17 00:00:00 2001 From: patritzenfeld Date: Wed, 28 Jan 2026 13:16:33 +0100 Subject: [PATCH 20/27] fix linter option typo --- .github/workflows/linter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 6b92d9c..a6a46c7 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -31,6 +31,6 @@ jobs: env: YAML_ERROR_ON_WARNING: true GITHUB_ACTIONS_COMMAND_ARGS: -shellcheck= - VALIDATE_MMARKDOWN_PRETTIER: false + VALIDATE_MARKDOWN_PRETTIER: false VALIDATE_YAML_PRETTIER: false GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 5461cdfb3b62a8dac3796ff11b55e3b957ac7d70 Mon Sep 17 00:00:00 2001 From: patritzenfeld Date: Wed, 28 Jan 2026 13:23:26 +0100 Subject: [PATCH 21/27] formatting in hie and yaml files --- .editorconfig | 1 + hie.yaml | 1 + package.yaml | 21 +++++++++++---------- raw/embedded/hie.yaml | 1 + raw/embedded/package.yaml | 1 + raw/embedded/stack.yaml | 15 ++++++++------- raw/package.yaml | 15 ++++++++------- raw/stack.yaml | 1 + stack.yaml | 1 + 9 files changed, 33 insertions(+), 24 deletions(-) diff --git a/.editorconfig b/.editorconfig index ffbd1ce..0356765 100644 --- a/.editorconfig +++ b/.editorconfig @@ -9,6 +9,7 @@ max_line_length = 120 [**.{yml,yaml,md}] max_line_length = 160 +indent_size = 2 [.github/actions/spelling/*] max_line_length = unset diff --git a/hie.yaml b/hie.yaml index d85179a..2c0d52c 100644 --- a/hie.yaml +++ b/hie.yaml @@ -1,3 +1,4 @@ +--- cradle: stack: - path: "./src" diff --git a/package.yaml b/package.yaml index 1788434..b692adf 100644 --- a/package.yaml +++ b/package.yaml @@ -1,19 +1,20 @@ -name: haskell-template-task -version: 0.2 -github: "fmidue/haskell-template-task" -license: MIT -author: "Marcellus Siegburg" -maintainer: "marcellus.siegburg@uni-due.de" -copyright: "2020 Formal Methods in Computer Science - University of Duisburg-Essen" +--- +name: haskell-template-task +version: 0.2 +github: "fmidue/haskell-template-task" +license: MIT +author: "Marcellus Siegburg" +maintainer: "marcellus.siegburg@uni-due.de" +copyright: "2020 Formal Methods in Computer Science - University of Duisburg-Essen" extra-source-files: - README.md - ChangeLog.md -synopsis: A task type for haskell tasks developed for the e-learning platform Autotool -category: E-Learning +synopsis: A task type for haskell tasks developed for the e-learning platform Autotool +category: E-Learning -description: Please see the README on GitHub at +description: Please see the README on GitHub at dependencies: - base >= 4.7 && < 5 diff --git a/raw/embedded/hie.yaml b/raw/embedded/hie.yaml index 9ecf604..008aaed 100644 --- a/raw/embedded/hie.yaml +++ b/raw/embedded/hie.yaml @@ -1,3 +1,4 @@ +--- cradle: stack: - path: "./src" diff --git a/raw/embedded/package.yaml b/raw/embedded/package.yaml index 95009cf..78567bf 100644 --- a/raw/embedded/package.yaml +++ b/raw/embedded/package.yaml @@ -1,3 +1,4 @@ +--- name: haskell-template-task-embedded ghc-options: -Wall diff --git a/raw/embedded/stack.yaml b/raw/embedded/stack.yaml index 4561d1c..3e9618b 100644 --- a/raw/embedded/stack.yaml +++ b/raw/embedded/stack.yaml @@ -1,13 +1,14 @@ +--- resolver: lts-21.25 packages: -- . + - . extra-deps: -- git: https://github.com/fmidue/IOTasks - commit: 3b33001441a888ae3443def19e516e4c699fb95f + - git: https://github.com/fmidue/IOTasks + commit: 3b33001441a888ae3443def19e516e4c699fb95f -- git: https://github.com/owestphal/type-match - commit: e1afab43d2e8bfa5e2006492ed34060036e7be51 + - git: https://github.com/owestphal/type-match + commit: e1afab43d2e8bfa5e2006492ed34060036e7be51 -- git: https://github.com/IagoAbal/haskell-z3 - commit: 6368e451e45359563106da7e917f6594453c5161 + - git: https://github.com/IagoAbal/haskell-z3 + commit: 6368e451e45359563106da7e917f6594453c5161 diff --git a/raw/package.yaml b/raw/package.yaml index b0ef3a9..fa14a4c 100644 --- a/raw/package.yaml +++ b/raw/package.yaml @@ -1,12 +1,13 @@ -name: haskell-template-task-raw -version: 0.0.0.1 +--- +name: haskell-template-task-raw +version: 0.0.0.1 ghc-options: - - -Wall + - -Wall dependencies: - - base >= 4.7 && < 5 - - filepath - - template-haskell - - th-utilities + - base >= 4.7 && < 5 + - filepath + - template-haskell + - th-utilities library: source-dirs: src diff --git a/raw/stack.yaml b/raw/stack.yaml index f5a60b6..dba5645 100644 --- a/raw/stack.yaml +++ b/raw/stack.yaml @@ -1,3 +1,4 @@ +--- resolver: lts-21.25 packages: - . diff --git a/stack.yaml b/stack.yaml index 76b46ee..ceaaecf 100644 --- a/stack.yaml +++ b/stack.yaml @@ -1,3 +1,4 @@ +--- resolver: lts-21.25 packages: - . From 52b1922445971c1a04d7cb35b0997ebe0d1bfebb Mon Sep 17 00:00:00 2001 From: patritzenfeld Date: Wed, 28 Jan 2026 13:27:31 +0100 Subject: [PATCH 22/27] update super-linter version --- .github/workflows/linter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index a6a46c7..68015b4 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -27,7 +27,7 @@ jobs: fetch-depth: 0 - name: Run Linter - uses: github/super-linter@v7 + uses: super-linter/super-linter/slim@v8.3.2 env: YAML_ERROR_ON_WARNING: true GITHUB_ACTIONS_COMMAND_ARGS: -shellcheck= From e46879e9f16c62dfeaca6e60f26a6cc255d9e344 Mon Sep 17 00:00:00 2001 From: patritzenfeld Date: Wed, 28 Jan 2026 13:28:20 +0100 Subject: [PATCH 23/27] more yaml formatting --- package.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.yaml b/package.yaml index b692adf..0d72b7b 100644 --- a/package.yaml +++ b/package.yaml @@ -45,8 +45,8 @@ library: tests: haskell-template-task-test: - main: Spec.hs - source-dirs: test + main: Spec.hs + source-dirs: test ghc-options: - -threaded - -rtsopts From f1ea0352980fed43b2fd5107e0774ec6efef8b59 Mon Sep 17 00:00:00 2001 From: patritzenfeld Date: Wed, 28 Jan 2026 13:35:09 +0100 Subject: [PATCH 24/27] add linter configs --- .github/linters/.markdown-lint.yml | 23 ++++++++++++ .github/linters/.yaml-lint.yml | 59 ++++++++++++++++++++++++++++++ .github/linters/zizmor.yaml | 6 +++ 3 files changed, 88 insertions(+) create mode 100644 .github/linters/.markdown-lint.yml create mode 100644 .github/linters/.yaml-lint.yml create mode 100644 .github/linters/zizmor.yaml diff --git a/.github/linters/.markdown-lint.yml b/.github/linters/.markdown-lint.yml new file mode 100644 index 0000000..b7f2e9a --- /dev/null +++ b/.github/linters/.markdown-lint.yml @@ -0,0 +1,23 @@ +--- +default: true +extends: null + +# Unordered list indentation +MD007: + # Spaces for indent + indent: 4 + # Whether to indent the first level of the list + start_indented: false + # Spaces for first level indent (when start_indented is set) + start_indent: 2 + +# Multiple consecutive blank lines +MD012: + # Consecutive blank lines + maximum: 2 + +# Line length +MD013: false + +# Lists should be surrounded by blank lines +MD032: false diff --git a/.github/linters/.yaml-lint.yml b/.github/linters/.yaml-lint.yml new file mode 100644 index 0000000..8b01185 --- /dev/null +++ b/.github/linters/.yaml-lint.yml @@ -0,0 +1,59 @@ +--- +########################################### +# These are the rules used for # +# linting all the yaml files in the stack # +# NOTE: # +# You can disable line with: # +# # yamllint disable-line # +########################################### +rules: + braces: + level: warning + min-spaces-inside: 0 + max-spaces-inside: 0 + min-spaces-inside-empty: 1 + max-spaces-inside-empty: 5 + brackets: + level: warning + min-spaces-inside: 0 + max-spaces-inside: 0 + min-spaces-inside-empty: 1 + max-spaces-inside-empty: 5 + colons: + level: warning + max-spaces-before: 0 + max-spaces-after: 1 + commas: + level: warning + max-spaces-before: 0 + min-spaces-after: 1 + max-spaces-after: 1 + comments: disable + comments-indentation: disable + document-end: disable + document-start: + level: warning + present: true + empty-lines: + level: warning + max: 2 + max-start: 0 + max-end: 0 + hyphens: + level: warning + max-spaces-after: 1 + indentation: + level: warning + spaces: consistent + indent-sequences: true + check-multi-line-strings: false + key-duplicates: enable + line-length: + level: warning + max: 140 + allow-non-breakable-words: true + allow-non-breakable-inline-mappings: true + new-line-at-end-of-file: disable + new-lines: + type: unix + trailing-spaces: disable diff --git a/.github/linters/zizmor.yaml b/.github/linters/zizmor.yaml new file mode 100644 index 0000000..bbb0366 --- /dev/null +++ b/.github/linters/zizmor.yaml @@ -0,0 +1,6 @@ +--- +rules: + unpinned-uses: + config: + policies: + "*": ref-pin From e77a1278740b4a1e6e8d43021475de73e0765f1b Mon Sep 17 00:00:00 2001 From: patritzenfeld Date: Wed, 28 Jan 2026 13:44:13 +0100 Subject: [PATCH 25/27] disable markdown linter rule --- .github/linters/.markdown-lint.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/linters/.markdown-lint.yml b/.github/linters/.markdown-lint.yml index b7f2e9a..a03953b 100644 --- a/.github/linters/.markdown-lint.yml +++ b/.github/linters/.markdown-lint.yml @@ -21,3 +21,6 @@ MD013: false # Lists should be surrounded by blank lines MD032: false + +# Disable ASCII table check +MD060: false From 62cd0657f9523a45af2ea3364c6171037d6905f6 Mon Sep 17 00:00:00 2001 From: patritzenfeld Date: Wed, 28 Jan 2026 13:44:30 +0100 Subject: [PATCH 26/27] zizmor lint --- .github/workflows/haskell.yml | 2 ++ .github/workflows/hlint.yml | 2 ++ .github/workflows/linter.yml | 1 + 3 files changed, 5 insertions(+) diff --git a/.github/workflows/haskell.yml b/.github/workflows/haskell.yml index 8d32ddd..61a971f 100644 --- a/.github/workflows/haskell.yml +++ b/.github/workflows/haskell.yml @@ -22,6 +22,8 @@ jobs: steps: - uses: actions/checkout@v4 + with: + persist-credentials: false - name: Cache Stack id: cache-stack-unix diff --git a/.github/workflows/hlint.yml b/.github/workflows/hlint.yml index c37d63e..ff9a88e 100644 --- a/.github/workflows/hlint.yml +++ b/.github/workflows/hlint.yml @@ -14,6 +14,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + with: + persist-credentials: false - name: 'Set up HLint' uses: haskell-actions/hlint-setup@v2 diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 68015b4..73251df 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -25,6 +25,7 @@ jobs: # Full git history is needed to get a proper # list of changed files within `super-linter` fetch-depth: 0 + persist-credentials: false - name: Run Linter uses: super-linter/super-linter/slim@v8.3.2 From a8dd3416f9d4d8052e0c63ce9d5f43083f5e41b1 Mon Sep 17 00:00:00 2001 From: patritzenfeld Date: Wed, 28 Jan 2026 13:44:43 +0100 Subject: [PATCH 27/27] align spelling workflow with other repos --- .github/workflows/spelling.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/spelling.yml b/.github/workflows/spelling.yml index 348b69a..b275bd4 100644 --- a/.github/workflows/spelling.yml +++ b/.github/workflows/spelling.yml @@ -4,7 +4,8 @@ name: Check Spelling on: push: branches: ["master"] - pull_request_target: + pull_request: + branches: ['**'] issue_comment: types: [created]