Skip to content

Commit

Permalink
Move top-level Github/VSCode configuration files (#2037)
Browse files Browse the repository at this point in the history
* move Mergify, Restyled, Haskell-CI and Pull Request template to `.github`
  * regenerate Haskell-CI file with the new path and new Haskell CI version
* move CSpell from VSCode [Code Spell Checker](https://open-vsx.org/extension/streetsidesoftware/code-spell-checker) extension to `.vscode`

This is a complementary top-level cleanup to #2015.
  • Loading branch information
xsebek authored Jul 14, 2024
1 parent 54304e7 commit 244c882
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 20 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
19 changes: 9 additions & 10 deletions .github/workflows/haskell-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@
#
# This GitHub workflow config has been generated by a script via
#
# haskell-ci 'github' '--config=cabal.haskell-ci' '--copy-fields=all' 'swarm.cabal'
# haskell-ci 'github' '--config=.github/workflows/cabal.haskell-ci' '--copy-fields=all' 'swarm.cabal'
#
# To regenerate the script (for example after adjusting tested-with) run
#
# haskell-ci regenerate
#
# For more information, see https://github.com/haskell-CI/haskell-ci
#
# version: 0.19.20240501
# version: 0.19.20240708
#
# REGENDATA ("0.19.20240501",["github","--config=cabal.haskell-ci","--copy-fields=all","swarm.cabal"])
# REGENDATA ("0.19.20240708",["github","--config=.github/workflows/cabal.haskell-ci","--copy-fields=all","swarm.cabal"])
#
name: Haskell-CI
on:
Expand Down Expand Up @@ -84,11 +84,10 @@ jobs:
apt-get update
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5
mkdir -p "$HOME/.ghcup/bin"
curl -sL https://downloads.haskell.org/ghcup/0.1.20.0/x86_64-linux-ghcup-0.1.20.0 > "$HOME/.ghcup/bin/ghcup"
curl -sL https://downloads.haskell.org/ghcup/0.1.30.0/x86_64-linux-ghcup-0.1.30.0 > "$HOME/.ghcup/bin/ghcup"
chmod a+x "$HOME/.ghcup/bin/ghcup"
"$HOME/.ghcup/bin/ghcup" config add-release-channel https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-prereleases-0.0.8.yaml;
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
"$HOME/.ghcup/bin/ghcup" install cabal 3.12.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
env:
HCKIND: ${{ matrix.compilerKind }}
HCNAME: ${{ matrix.compiler }}
Expand All @@ -106,7 +105,7 @@ jobs:
echo "HC=$HC" >> "$GITHUB_ENV"
echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.2.0 -vnormal+nowrap" >> "$GITHUB_ENV"
echo "CABAL=$HOME/.ghcup/bin/cabal-3.12.1.0 -vnormal+nowrap" >> "$GITHUB_ENV"
HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')
echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV"
echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV"
Expand Down Expand Up @@ -165,8 +164,8 @@ jobs:
- name: install cabal-docspec
run: |
mkdir -p $HOME/.cabal/bin
curl -sL https://github.com/phadej/cabal-extras/releases/download/cabal-docspec-0.0.0.20240414/cabal-docspec-0.0.0.20240414-x86_64-linux.xz > cabal-docspec.xz
echo '2d18a3f79619e8ec5f11870f926f6dc2616e02a6c889315b7f82044b95a1adb9 cabal-docspec.xz' | sha256sum -c -
curl -sL https://github.com/phadej/cabal-extras/releases/download/cabal-docspec-0.0.0.20240703/cabal-docspec-0.0.0.20240703-x86_64-linux.xz > cabal-docspec.xz
echo '48bf3b7fd2f7f0caa6162afee57a755be8523e7f467b694900eb420f5f9a7b76 cabal-docspec.xz' | sha256sum -c -
xz -d < cabal-docspec.xz > $HOME/.cabal/bin/cabal-docspec
rm -f cabal-docspec.xz
chmod a+x $HOME/.cabal/bin/cabal-docspec
Expand Down Expand Up @@ -201,7 +200,7 @@ jobs:
cat >> cabal.project <<EOF
flags: +ci
EOF
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(swarm)$/; }' >> cabal.project.local
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: any.$_ installed\n" unless /^(swarm)$/; }' >> cabal.project.local
cat cabal.project
cat cabal.project.local
- name: dump install plan
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ dist-newstyle/
TAGS

.vscode/
!.vscode/cspell.json

cabal.project.local
hie.yaml
Expand Down
File renamed without changes.
20 changes: 10 additions & 10 deletions scripts/gen/autopopulate-spellchecker.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
#!/bin/bash -e

cd $(git rev-parse --show-toplevel)
cd "$(git rev-parse --show-toplevel)"

DBNAME=hie.sqlite
scripts/gen/hiedb.sh $DBNAME
scripts/gen/hiedb.sh "$DBNAME"

WORDS_TMPFILE_UNSORTED=$(mktemp --suffix .words)

# First, get all variable names that originate from external packages.
# Exclude names that contain symbols other than underscore or apostrophe or do not contain any letters.
sqlite3 $DBNAME "SELECT substr(sym, 3) FROM (SELECT DISTINCT occ AS sym FROM refs WHERE unit NOT IN (SELECT DISTINCT unit FROM mods)) ORDER BY sym" | grep -v "[^[:alnum:]_']" | grep "[[:alpha:]]" > $WORDS_TMPFILE_UNSORTED
sqlite3 "$DBNAME" "SELECT substr(sym, 3) FROM (SELECT DISTINCT occ AS sym FROM refs WHERE unit NOT IN (SELECT DISTINCT unit FROM mods)) ORDER BY sym" | grep -v "[^[:alnum:]_']" | grep "[[:alpha:]]" >"$WORDS_TMPFILE_UNSORTED"

# Next, append the individual "conids" extracted from all "modids" that originate from external packages.
# See definition of "conid" and "monid" here:
Expand All @@ -26,19 +26,19 @@ sqlite3 $DBNAME "SELECT substr(sym, 3) FROM (SELECT DISTINCT occ AS sym FROM ref
# Control
# Data
# Text
sqlite3 $DBNAME "SELECT DISTINCT mod FROM refs WHERE unit NOT IN (SELECT DISTINCT unit FROM mods)" | tr '.' '\n' >> $WORDS_TMPFILE_UNSORTED
sqlite3 "$DBNAME" "SELECT DISTINCT mod FROM refs WHERE unit NOT IN (SELECT DISTINCT unit FROM mods)" | tr '.' '\n' >>"$WORDS_TMPFILE_UNSORTED"

WORDS_TMPFILE=$(mktemp --suffix .words)
sort -u $WORDS_TMPFILE_UNSORTED > $WORDS_TMPFILE
rm $WORDS_TMPFILE_UNSORTED
sort -u "$WORDS_TMPFILE_UNSORTED" >"$WORDS_TMPFILE"
rm "$WORDS_TMPFILE_UNSORTED"

CSPELL_TMPFILE=$(mktemp --suffix .cspell)
CSPELL_FILEPATH=cspell.json
CSPELL_FILEPATH=.vscode/cspell.json

# Now, stuff the sorted list of names into the cspell JSON file word list.
jq '.words = $newWords' --slurpfile newWords <(jq --raw-input --null-input 'inputs' $WORDS_TMPFILE) $CSPELL_FILEPATH > $CSPELL_TMPFILE
jq '.words = $newWords' --slurpfile newWords <(jq --raw-input --null-input 'inputs' "$WORDS_TMPFILE") "$CSPELL_FILEPATH" >"$CSPELL_TMPFILE"

# Overwrite the original with the modified version.
mv $CSPELL_TMPFILE $CSPELL_FILEPATH
mv "$CSPELL_TMPFILE" "$CSPELL_FILEPATH"

rm $WORDS_TMPFILE
rm "$WORDS_TMPFILE"

0 comments on commit 244c882

Please sign in to comment.