From 0cae22277c5f4f3cbeb5bb0f2b3eafb3c26869dd Mon Sep 17 00:00:00 2001 From: Jan Philipp Thiele Date: Mon, 25 Nov 2024 14:13:02 +0100 Subject: [PATCH 1/8] [pre-commit] add check for large files --- .pre-commit-config.yaml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100755 .pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100755 index 0000000..9ce1deb --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,6 @@ +repos: +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v5.0.0 + hooks: + - id: check-added-large-files + args: [--maxkb=8192] From 2955bee5c1c5da1fede5723e614d8b6aeab5b55c Mon Sep 17 00:00:00 2001 From: Jan Philipp Thiele Date: Mon, 25 Nov 2024 14:17:46 +0100 Subject: [PATCH 2/8] [pre-commit] add check for merge conflicts --- .pre-commit-config.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9ce1deb..bd0fcc3 100755 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,3 +4,4 @@ repos: hooks: - id: check-added-large-files args: [--maxkb=8192] + - id: check-merge-conflict From 642695da7eb2e6b2028293f6f3d10f5b48d2b282 Mon Sep 17 00:00:00 2001 From: Jan Philipp Thiele Date: Mon, 25 Nov 2024 14:19:12 +0100 Subject: [PATCH 3/8] [pre-commit] add check for TOML and YAML syntax --- .pre-commit-config.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index bd0fcc3..ee13d23 100755 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,3 +5,6 @@ repos: - id: check-added-large-files args: [--maxkb=8192] - id: check-merge-conflict + - id: check-toml + - id: check-yaml + args: [--allow-multiple-documents] From cef03938bdb43854fa5e30260d66c2ff61da3c2f Mon Sep 17 00:00:00 2001 From: Jan Philipp Thiele Date: Mon, 25 Nov 2024 14:22:29 +0100 Subject: [PATCH 4/8] [pre-commit] add and apply end of file fixer --- .JuliaFormatter.toml | 2 +- .github/workflows/ci.yml | 2 +- .gitignore | 1 - .pre-commit-config.yaml | 1 + .zenodo.json | 1 - CHANGELOG.md | 1 - docs/src/linearsolve.md | 1 - ext/ExtendableSparseIncompleteLUExt.jl | 1 - ext/ExtendableSparseLinearSolveExt.jl | 1 - ext/ExtendableSparsePardisoExt.jl | 1 - src/compat.jl | 1 - src/experimental/Experimental.jl | 1 - .../ilu_Al-Kurdi_Mittal.jl | 2 +- .../ExtendableSparseMatrixParallel/iluam.jl | 1 - .../pilu_Al-Kurdi_Mittal.jl | 2 +- .../ExtendableSparseMatrixParallel/piluam.jl | 1 - .../ExtendableSparseMatrixParallel/struct_flush.jl | 7 ------- .../ExtendableSparseMatrixParallel/supersparse.jl | 11 ----------- src/factorizations/iluzero.jl | 2 -- src/factorizations/parallel_ilu0.jl | 1 - src/factorizations/umfpack_lu.jl | 1 - src/matrix/extendable.jl | 2 -- src/matrix/genericextendablesparsematrixcsc.jl | 1 - 23 files changed, 5 insertions(+), 40 deletions(-) diff --git a/.JuliaFormatter.toml b/.JuliaFormatter.toml index 5458760..2042d72 100644 --- a/.JuliaFormatter.toml +++ b/.JuliaFormatter.toml @@ -4,4 +4,4 @@ format_markdown = true import_to_using = false pipe_to_function_call = false short_to_long_function_def = false -always_use_return = false \ No newline at end of file +always_use_return = false diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9b4bd2a..f220367 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -76,4 +76,4 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} - \ No newline at end of file + diff --git a/.gitignore b/.gitignore index 068167e..42b2696 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,3 @@ docs/build Manifest*.toml .repl_history quarry - diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ee13d23..b5c85c0 100755 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -8,3 +8,4 @@ repos: - id: check-toml - id: check-yaml args: [--allow-multiple-documents] + - id: end-of-file-fixer diff --git a/.zenodo.json b/.zenodo.json index 0271065..22b6fb5 100644 --- a/.zenodo.json +++ b/.zenodo.json @@ -20,4 +20,3 @@ "license": "MIT", "upload_type": "software" } - diff --git a/CHANGELOG.md b/CHANGELOG.md index 2cc5f71..a02a503 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -56,4 +56,3 @@ Introducd 1.9 extensions - Implement AbstractSparseMatrixCSC interface. - Remove extension of LinearSolve methodsa - diff --git a/docs/src/linearsolve.md b/docs/src/linearsolve.md index a158635..7dbf531 100644 --- a/docs/src/linearsolve.md +++ b/docs/src/linearsolve.md @@ -149,4 +149,3 @@ y = LinearSolve.solve(LinearProblem(A, b), KrylovJL_CG(); Pl = ILUZero.ilu0(SparseMatrixCSC(A))).u sum(y) ``` - diff --git a/ext/ExtendableSparseIncompleteLUExt.jl b/ext/ExtendableSparseIncompleteLUExt.jl index bfeb7ed..2a1e7bc 100644 --- a/ext/ExtendableSparseIncompleteLUExt.jl +++ b/ext/ExtendableSparseIncompleteLUExt.jl @@ -42,4 +42,3 @@ function update!(precon::ILUTPreconditioner) end end - diff --git a/ext/ExtendableSparseLinearSolveExt.jl b/ext/ExtendableSparseLinearSolveExt.jl index 2c5335a..8743955 100644 --- a/ext/ExtendableSparseLinearSolveExt.jl +++ b/ext/ExtendableSparseLinearSolveExt.jl @@ -23,4 +23,3 @@ end (b::LinearSolvePreconBuilder)(A::AbstractSparseMatrixCSC,p) = (LinearSolvePrecon(A,b.method), LinearAlgebra.I) end - diff --git a/ext/ExtendableSparsePardisoExt.jl b/ext/ExtendableSparsePardisoExt.jl index 69b8e29..92532e0 100644 --- a/ext/ExtendableSparsePardisoExt.jl +++ b/ext/ExtendableSparsePardisoExt.jl @@ -109,4 +109,3 @@ end end end - diff --git a/src/compat.jl b/src/compat.jl index 570f712..b14f960 100644 --- a/src/compat.jl +++ b/src/compat.jl @@ -15,4 +15,3 @@ macro public(ex) nothing end end - diff --git a/src/experimental/Experimental.jl b/src/experimental/Experimental.jl index 61982a4..4769e4c 100644 --- a/src/experimental/Experimental.jl +++ b/src/experimental/Experimental.jl @@ -40,4 +40,3 @@ export reorderlinsys, nnz_noflush end - diff --git a/src/experimental/ExtendableSparseMatrixParallel/ilu_Al-Kurdi_Mittal.jl b/src/experimental/ExtendableSparseMatrixParallel/ilu_Al-Kurdi_Mittal.jl index ad2207d..6223d10 100644 --- a/src/experimental/ExtendableSparseMatrixParallel/ilu_Al-Kurdi_Mittal.jl +++ b/src/experimental/ExtendableSparseMatrixParallel/ilu_Al-Kurdi_Mittal.jl @@ -264,4 +264,4 @@ end -#end \ No newline at end of file +#end diff --git a/src/experimental/ExtendableSparseMatrixParallel/iluam.jl b/src/experimental/ExtendableSparseMatrixParallel/iluam.jl index 24b75be..0e70f74 100644 --- a/src/experimental/ExtendableSparseMatrixParallel/iluam.jl +++ b/src/experimental/ExtendableSparseMatrixParallel/iluam.jl @@ -32,4 +32,3 @@ end allow_views(::ILUAMPreconditioner)=true allow_views(::Type{ILUAMPreconditioner})=true - diff --git a/src/experimental/ExtendableSparseMatrixParallel/pilu_Al-Kurdi_Mittal.jl b/src/experimental/ExtendableSparseMatrixParallel/pilu_Al-Kurdi_Mittal.jl index ad9529b..157785f 100644 --- a/src/experimental/ExtendableSparseMatrixParallel/pilu_Al-Kurdi_Mittal.jl +++ b/src/experimental/ExtendableSparseMatrixParallel/pilu_Al-Kurdi_Mittal.jl @@ -348,4 +348,4 @@ function nnz(ilu::PILUAMPrecon{T,N}) where {T,N<:Integer} length(ilu.nzval) end -#end \ No newline at end of file +#end diff --git a/src/experimental/ExtendableSparseMatrixParallel/piluam.jl b/src/experimental/ExtendableSparseMatrixParallel/piluam.jl index 50a46fd..1fe37ce 100644 --- a/src/experimental/ExtendableSparseMatrixParallel/piluam.jl +++ b/src/experimental/ExtendableSparseMatrixParallel/piluam.jl @@ -33,4 +33,3 @@ end allow_views(::PILUAMPreconditioner)=true allow_views(::Type{PILUAMPreconditioner})=true - diff --git a/src/experimental/ExtendableSparseMatrixParallel/struct_flush.jl b/src/experimental/ExtendableSparseMatrixParallel/struct_flush.jl index 3169d4b..8a34dab 100644 --- a/src/experimental/ExtendableSparseMatrixParallel/struct_flush.jl +++ b/src/experimental/ExtendableSparseMatrixParallel/struct_flush.jl @@ -264,10 +264,3 @@ function dense_flush_removezeros!( ) end - - - - - - - diff --git a/src/experimental/ExtendableSparseMatrixParallel/supersparse.jl b/src/experimental/ExtendableSparseMatrixParallel/supersparse.jl index 691e158..1175c5e 100644 --- a/src/experimental/ExtendableSparseMatrixParallel/supersparse.jl +++ b/src/experimental/ExtendableSparseMatrixParallel/supersparse.jl @@ -785,14 +785,3 @@ end function form(x) [minimum(x), mean(x), maximum(x)] end - - - - - - - - - - - diff --git a/src/factorizations/iluzero.jl b/src/factorizations/iluzero.jl index efc7ef7..af9bc12 100644 --- a/src/factorizations/iluzero.jl +++ b/src/factorizations/iluzero.jl @@ -96,5 +96,3 @@ function LinearAlgebra.ldiv!(u,p::PointBlockILUZeroPreconditioner,v) ) u end - - diff --git a/src/factorizations/parallel_ilu0.jl b/src/factorizations/parallel_ilu0.jl index 0728d10..d4e8b91 100644 --- a/src/factorizations/parallel_ilu0.jl +++ b/src/factorizations/parallel_ilu0.jl @@ -215,4 +215,3 @@ function update!(p::ParallelILU0Preconditioner) end p end - diff --git a/src/factorizations/umfpack_lu.jl b/src/factorizations/umfpack_lu.jl index 34d52c1..31dae29 100644 --- a/src/factorizations/umfpack_lu.jl +++ b/src/factorizations/umfpack_lu.jl @@ -25,4 +25,3 @@ function update!(lufact::LUFactorization) end lufact end - diff --git a/src/matrix/extendable.jl b/src/matrix/extendable.jl index 51035c5..e38ef9a 100644 --- a/src/matrix/extendable.jl +++ b/src/matrix/extendable.jl @@ -316,5 +316,3 @@ function pointblock(A0::ExtendableSparseMatrixCSC{Tv,Ti},blocksize) where {Tv,Ti end flush!(Ab) end - - diff --git a/src/matrix/genericextendablesparsematrixcsc.jl b/src/matrix/genericextendablesparsematrixcsc.jl index 457413e..fe1465f 100644 --- a/src/matrix/genericextendablesparsematrixcsc.jl +++ b/src/matrix/genericextendablesparsematrixcsc.jl @@ -90,4 +90,3 @@ function updateindex!(ext::GenericExtendableSparseMatrixCSC, updateindex!(ext.xmatrix,op,v,i,j) end end - From b28c7111101393e593bc0561bb0a1d629504b670 Mon Sep 17 00:00:00 2001 From: Jan Philipp Thiele Date: Mon, 25 Nov 2024 14:26:32 +0100 Subject: [PATCH 5/8] [pre-commit] add no master branch commit check --- .pre-commit-config.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b5c85c0..42f8b15 100755 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,3 +9,5 @@ repos: - id: check-yaml args: [--allow-multiple-documents] - id: end-of-file-fixer + - id: no-commit-to-branch + args: [--branch,master] From 5477d71de2612b5a4b724aec93e8d967f772792c Mon Sep 17 00:00:00 2001 From: Jan Philipp Thiele Date: Mon, 25 Nov 2024 14:29:05 +0100 Subject: [PATCH 6/8] [pre-commit] add hardcoded secret check --- .pre-commit-config.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 42f8b15..b444f74 100755 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -11,3 +11,7 @@ repos: - id: end-of-file-fixer - id: no-commit-to-branch args: [--branch,master] +- repo: https://github.com/gitleaks/gitleaks + rev: v8.16.3 + hooks: + - id: gitleaks From 47105d05748777090ef30109151398312a433546 Mon Sep 17 00:00:00 2001 From: Jan Philipp Thiele Date: Mon, 25 Nov 2024 14:45:26 +0100 Subject: [PATCH 7/8] [pre-commit] add codespell check --- .codespellrc | 2 +- .pre-commit-config.yaml | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.codespellrc b/.codespellrc index b1ac4a3..7505bec 100644 --- a/.codespellrc +++ b/.codespellrc @@ -1,2 +1,2 @@ [codespell] -ignore-words-list = missings,rcall,linke,fo,COO,alledges +ignore-words-list = missings,rcall,linke,fo,coo,alledges diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b444f74..83a49f5 100755 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -15,3 +15,7 @@ repos: rev: v8.16.3 hooks: - id: gitleaks +- repo: https://github.com/codespell-project/codespell + rev: v2.2.4 + hooks: + - id: codespell From 914220bea192df6d34c863a98963998439b1f329 Mon Sep 17 00:00:00 2001 From: Jan Philipp Thiele Date: Mon, 25 Nov 2024 14:45:31 +0100 Subject: [PATCH 8/8] [pre-commit] add CI workflow file --- .github/workflows/pre-commit.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .github/workflows/pre-commit.yml diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml new file mode 100644 index 0000000..eac2920 --- /dev/null +++ b/.github/workflows/pre-commit.yml @@ -0,0 +1,21 @@ +name: pre-commit + +on: + pull_request: + +jobs: + pre-commit: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: julia-actions/setup-julia@v2 + with: + version: 1.11 + - run: | + julia --project=@runic -e ' + using Pkg + Pkg.add("Runic")' + env: + PYTHON: "" + - uses: actions/setup-python@v5 + - uses: pre-commit/action@v3.0.1