Skip to content

Commit

Permalink
Run ExplicitImport.jl's checks on CI, closes #886. (#954)
Browse files Browse the repository at this point in the history
  • Loading branch information
fredrikekre committed May 28, 2024
1 parent e3ec3eb commit 0b887aa
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 16 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/Check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
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@v1
- uses: julia-actions/julia-buildpkg@v1
- name: Install dependencies
shell: julia {0}
run: |
using Pkg
Pkg.add("ExplicitImports")
- name: ExplicitImports.jl code checks
shell: julia --project {0}
run: |
using Ferrite, ExplicitImports
allow_unanalyzable = (ApplyStrategy, ColoringAlgorithm) # baremodules
check_no_implicit_imports(Ferrite; allow_unanalyzable)
check_no_stale_explicit_imports(Ferrite; allow_unanalyzable)
check_all_qualified_accesses_via_owners(Ferrite)
13 changes: 0 additions & 13 deletions .github/workflows/lint.yml

This file was deleted.

2 changes: 1 addition & 1 deletion src/Export/VTK.jl
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ end
Base.close(vtk::VTKFile) = WriteVTK.vtk_save(vtk.vtk)

function Base.show(io::IO, ::MIME"text/plain", vtk::VTKFile)
open_str = WriteVTK.isopen(vtk.vtk) ? "open" : "closed"
open_str = isopen(vtk.vtk) ? "open" : "closed"
filename = vtk.vtk.path
print(io, "VTKFile for the $open_str file \"$(filename)\".")
end
Expand Down
4 changes: 2 additions & 2 deletions src/Ferrite.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ using NearestNeighbors:
using OrderedCollections:
OrderedSet
using SparseArrays:
SparseArrays, SparseMatrixCSC, nonzeros, nzrange, rowvals, sparse, spzeros
SparseArrays, SparseMatrixCSC, nonzeros, nzrange, rowvals, sparse
using StaticArrays:
StaticArrays, MMatrix, SMatrix, SVector
StaticArrays, SMatrix, SVector
using WriteVTK:
WriteVTK, VTKCellTypes
using Tensors:
Expand Down

0 comments on commit 0b887aa

Please sign in to comment.