Skip to content

Commit

Permalink
Switch from haskell-src-exts to ghc-lib-parser
Browse files Browse the repository at this point in the history
See #587 for the
background.
  • Loading branch information
toku-sa-n committed Dec 23, 2022
1 parent 4c2ea03 commit 84bb9b1
Show file tree
Hide file tree
Showing 45 changed files with 8,267 additions and 4,034 deletions.
15 changes: 10 additions & 5 deletions .github/workflows/Cabal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ jobs:
fail-fast: false # Windows builds randomly fail
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
ghc: ["8.2.2", "8.4.4", "8.6.5", "8.8.4", "8.10.2", "9.2.2"]
ghc: ["8.10.7", "9.2.2", "9.4.1"]
exclude:
- os: windows-latest
ghc: "9.4.1"
env:
CONFIG: "--enable-tests --enable-benchmarks"
steps:
Expand All @@ -43,13 +46,15 @@ jobs:
cabal-cache-v2-${{ runner.os }}-
- name: Build
run: cabal v2-build $CONFIG
if: matrix.os != 'macOS-latest' || matrix.ghc != '9.2.2'
# See https://gitlab.haskell.org/ghc/ghc/-/issues/20592#note_391266 for the problem and workaround.
# This problem is fixed in GHC 9.2.3.
- name: Build with a workaround for macOS
run: C_INCLUDE_PATH="`xcrun --show-sdk-path`/usr/include/ffi" cabal v2-build $CONFIG
if: matrix.os == 'macOS-latest' && matrix.ghc == '9.2.2'
- name: Run tests
# TODO(mihaimaruseac): fix tests on windows, currently fail with `NoFenceEnd`
if: matrix.os != 'windows-latest'
run: cabal v2-test $CONFIG
- name: Run benchmarks
# TODO(mihaimaruseac): fix benchmakrs on windows, currently fail with `NoFenceEnd`
if: matrix.os != 'windows-latest'
run: cabal v2-bench $CONFIG
- name: Generate documentation
run: cabal v2-haddock $CONFIG
Expand Down
54 changes: 54 additions & 0 deletions .github/workflows/scorecards.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Scorecards supply-chain security
on:
# Only the default branch is supported.
branch_protection_rule:
schedule:
- cron: '33 18 * * 5'
push:
branches: [ "master" ]

# Declare default permissions as read only.
permissions: read-all

jobs:
analysis:
name: Scorecards analysis
runs-on: ubuntu-latest
permissions:
# Needed to upload the results to code-scanning dashboard.
security-events: write
# Used to receive a badge.
id-token: write

steps:
- name: "Checkout code"
uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846 # tag=v3.0.0
with:
persist-credentials: false

- name: "Run analysis"
uses: ossf/scorecard-action@99c53751e09b9529366343771cc321ec74e9bd3d # tag=v2.0.6
with:
results_file: results.sarif
results_format: sarif

# Publish the results for public repositories to enable scorecard badges. For more details, see
# https://github.com/ossf/scorecard-action#publishing-results.
# For private repositories, `publish_results` will automatically be set to `false`, regardless
# of the value entered here.
publish_results: true

# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
# format to the repository Actions tab.
- name: "Upload artifact"
uses: actions/upload-artifact@6673cd052c4cd6fcf4b4e6e60ea986c889389535 # tag=v3.0.0
with:
name: SARIF file
path: results.sarif
retention-days: 5

# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@5f532563584d71fdef14ee64d17bafb34f751ce5 # tag=v1.0.26
with:
sarif_file: results.sarif
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ src/main/TestGenerate
.stack-work
.cabal-sandbox/
cabal.sandbox.config
dist-newstyle/
cabal.project.local
3 changes: 3 additions & 0 deletions .hindent.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
tab-size: 2
line-length: 80
force-trailing-newline: true
extensions:
- TypeApplications
- PatternSynonyms
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# hindent [![Hackage](https://img.shields.io/hackage/v/hindent.svg?style=flat)](https://hackage.haskell.org/package/hindent) ![CI (Stack)](https://github.com/mihaimaruseac/hindent/workflows/CI%20(Stack)/badge.svg) ![CI (Cabal)](https://github.com/mihaimaruseac/hindent/workflows/CI%20(Cabal)/badge.svg)
# hindent [![Hackage](https://img.shields.io/hackage/v/hindent.svg?style=flat)](https://hackage.haskell.org/package/hindent) ![CI (Stack)](https://github.com/mihaimaruseac/hindent/workflows/CI%20(Stack)/badge.svg) ![CI (Cabal)](https://github.com/mihaimaruseac/hindent/workflows/CI%20(Cabal)/badge.svg) [![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/mihaimaruseac/hindent/badge)](https://api.securityscorecards.dev/projects/github.com/mihaimaruseac/hindent)


Haskell pretty printer

Expand Down
Loading

0 comments on commit 84bb9b1

Please sign in to comment.