Skip to content

Commit

Permalink
track .cabal file
Browse files Browse the repository at this point in the history
- closes #5
  • Loading branch information
jvoigtlaender committed Oct 21, 2024
1 parent 8d8e79c commit 278d13c
Show file tree
Hide file tree
Showing 3 changed files with 510 additions and 1 deletion.
45 changes: 45 additions & 0 deletions .github/workflows/consistency.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
name: Check .cabal Consistency

on: [push, pull_request]

jobs:
check-consistency:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Save original cabal files
run: |
# shellcheck disable=SC2156
find . -name dist-newstyle -prune -o -type f -name '*.cabal' -exec sh -c \
"export i={}; grep -v '^--' \"\$i\" | grep -v '^$' > \"\$i.original\"; rm \"\$i\"" \;
- name: Set up Haskell
uses: haskell-actions/setup@v2
with:
enable-stack: true
stack-no-global: true

- name: Generate .cabal files from package.yaml
run: stack build --dry-run --no-install-ghc --stack-yaml=stack.yaml || true

- name: Save generated cabal file
run: |
# shellcheck disable=SC2156
find . -name dist-newstyle -prune -o -type f -name '*.cabal' -exec sh -c \
"export i={}; grep -v '^--' \"\$i\" | grep -v '^$' > \"\$i.generated\"" \;
- name: Print differences
run: |
export CORRECT=true
# shellcheck disable=SC2044
for i in $(find . -name dist-newstyle -prune -o -type f -name '*.cabal' -print); do \
if ! diff -u "$i.original" "$i.generated"; then \
CORRECT=false; \
continue; \
fi \
done
${CORRECT}
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
.DS_Store
*.cabal
.vscode/
.stack-work/
stack.yaml.lock
Expand Down
Loading

1 comment on commit 278d13c

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@check-spelling-bot Report

🔴 Please review

See the 📜action log or 📝 job summary for details.

Unrecognized words (5)

enum
hsc
Perim
SDe
SDg

To accept these unrecognized words as correct, you could run the following commands

... in a clone of the [email protected]:fmidue/sd-generate.git repository
on the main branch (ℹ️ how do I use this?):

curl -s -S -L 'https://raw.githubusercontent.com/check-spelling/check-spelling/v0.0.22/apply.pl' |
perl - 'https://github.com/fmidue/sd-generate/actions/runs/11441725011/attempts/1'
Available 📚 dictionaries could cover words not in the 📘 dictionary
Dictionary Entries Covers Uniquely
cspell:dart/src/dart.txt 3 1
cspell:rust/dict/rust.txt 30 1
cspell:csharp/csharp.txt 32 1
cspell:cpp/src/lang-keywords.txt 44 1
cspell:swift/src/swift.txt 53 1

Consider adding them (in .github/workflows/spelling.yml) for uses: check-spelling/[email protected] in its with:

      with:
        extra_dictionaries:
          cspell:dart/src/dart.txt
          cspell:rust/dict/rust.txt
          cspell:csharp/csharp.txt
          cspell:cpp/src/lang-keywords.txt
          cspell:swift/src/swift.txt

To stop checking additional dictionaries, add (in .github/workflows/spelling.yml) for uses: check-spelling/[email protected] in its with:

check_extra_dictionaries: ''
Errors (1)

See the 📜action log or 📝 job summary for details.

❌ Errors Count
❌ forbidden-pattern 1

See ❌ Event descriptions for more information.

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 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 that would match it,
    try adding it to the patterns.txt file.

    Patterns are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your lines.

    Note that patterns can't match multiline strings.

Please sign in to comment.