diff --git a/.github/workflows/Format.yml b/.github/workflows/Format.yml deleted file mode 100644 index dd2b2c50..00000000 --- a/.github/workflows/Format.yml +++ /dev/null @@ -1,12 +0,0 @@ -name: Format suggestions -on: - pull_request: - # this argument is not required if you don't use the `suggestion-label` input - types: [opened, reopened, synchronize, labeled, unlabeled] -jobs: - code-style: - runs-on: ubuntu-latest - steps: - - uses: julia-actions/julia-format@v4 - with: - version: '1' # Set `version` to '1.0.54' if you need to use JuliaFormatter.jl v1.0.54 (default: '1') diff --git a/.github/workflows/PreCommit.yml b/.github/workflows/PreCommit.yml new file mode 100644 index 00000000..1dc47d65 --- /dev/null +++ b/.github/workflows/PreCommit.yml @@ -0,0 +1,17 @@ +name: pre-commit + +on: + pull_request: + push: + branches: [main] + +jobs: + pre-commit: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v3 + - uses: julia-actions/setup-julia@v3 + - uses: julia-actions/cache@v3 + - run: julia -e 'using Pkg; Pkg.Registry.add("General"); Pkg.Apps.add("JuliaFormatter")' + - uses: pre-commit/action@v3.0.1 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..67d993b5 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,5 @@ +repos: +- repo: https://github.com/JuliaEditorSupport/JuliaFormatter.jl + rev: 0935890389c9fbc45f4ee150064c0abe5340b6a9 # v2.4.0 + hooks: + - id: "jlfmt" \ No newline at end of file