Skip to content

Commit

Permalink
Add pre-commit and ExplicitImports code checks
Browse files Browse the repository at this point in the history
  • Loading branch information
fredrikekre committed Sep 28, 2024
1 parent 90a92d7 commit 1c0e130
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 5 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/Check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Code checks

on:
pull_request:
push:
branches: ["master"]

jobs:

pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1

explicit-imports:
runs-on: ubuntu-latest
name: "ExplicitImports.jl"
steps:
- uses: actions/checkout@v4
# - uses: julia-actions/setup-julia@v2
# with:
# version: '1'
- uses: julia-actions/cache@v2
- uses: julia-actions/julia-buildpkg@v1
- name: Install dependencies
shell: julia {0}
run: |
# Add ExplicitImports.jl
using Pkg
Pkg.add([PackageSpec(name = "ExplicitImports", version = "1.9")])
- name: ExplicitImports.jl code checks
shell: julia --project {0}
run: |
using HYPRE, ExplicitImports
check_no_implicit_imports(HYPRE)
check_no_stale_explicit_imports(HYPRE)
check_all_qualified_accesses_via_owners(HYPRE)
check_no_self_qualified_accesses(HYPRE)
11 changes: 11 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
- id: check-added-large-files
- id: check-case-conflict
- id: check-toml
- id: check-yaml
- id: end-of-file-fixer
- id: mixed-line-ending
- id: trailing-whitespace
5 changes: 2 additions & 3 deletions lib/LibHYPRE.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using HYPRE_jll
using HYPRE_jll: HYPRE_jll, libHYPRE
export HYPRE_jll

using CEnum
using CEnum: @cenum

using MPI: MPI, MPI_Comm
if isdefined(MPI, :API) # MPI >= 0.20.0
Expand Down Expand Up @@ -3744,4 +3744,3 @@ const HYPRE_ERROR_MEMORY = 2
const HYPRE_ERROR_ARG = 4

const HYPRE_ERROR_CONV = 256

4 changes: 2 additions & 2 deletions src/HYPRE.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ using MPI: MPI
using PartitionedArrays: PartitionedArrays, AbstractLocalIndices, MPIArray, PSparseMatrix,
PVector, SplitMatrix, ghost_to_global, local_values, own_to_global, own_values,
partition
using SparseArrays: SparseArrays, SparseMatrixCSC, nnz, nonzeros, nzrange, rowvals
using SparseMatricesCSR: SparseMatrixCSR, colvals, getrowptr
using SparseArrays: SparseArrays, SparseMatrixCSC, nonzeros, nzrange, rowvals
using SparseMatricesCSR: SparseMatrixCSR, colvals

export HYPREMatrix, HYPREVector

Expand Down

0 comments on commit 1c0e130

Please sign in to comment.