Skip to content

Commit

Permalink
Merge pull request #75 from jpthiele/precommit
Browse files Browse the repository at this point in the history
[CI/Infra] Add pre-commit to repo
  • Loading branch information
jpthiele authored Nov 26, 2024
2 parents ed02dbe + b1b8d5e commit ac041e2
Show file tree
Hide file tree
Showing 32 changed files with 50 additions and 39 deletions.
2 changes: 2 additions & 0 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[codespell]
ignore-words-list = missings,rcall,linke,fo
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,4 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}


21 changes: 21 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ docs/src/*examples
Manifest*.toml
.repl_history.jl
quarry
*.vtu
*.vtu
21 changes: 21 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-added-large-files
args: [--maxkb=8192]
- id: check-merge-conflict
- id: check-toml
- id: check-yaml
args: [--allow-multiple-documents]
- 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
- repo: https://github.com/codespell-project/codespell
rev: v2.2.4
hooks:
- id: codespell
2 changes: 0 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -1143,5 +1143,3 @@ added DocStringExtensions
- Add Printf in Project.toml

- Fixed compat...


1 change: 0 additions & 1 deletion docs/src/coordinatesystem.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,3 @@ coordinatesystems() #hide
Modules = [ExtendableGrids]
Pages = ["coordinatesystem.jl"]
```

1 change: 0 additions & 1 deletion docs/src/elementgeometry.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,3 @@ elementgeometries() #hide
Modules = [ExtendableGrids]
Pages = ["elementgeometry.jl"]
```

1 change: 0 additions & 1 deletion docs/src/extendablegrid.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,3 @@ show(g[NodeCells])
Modules = [ExtendableGrids]
Pages = ["extendablegrid.jl"]
```

1 change: 0 additions & 1 deletion docs/src/gridconstructors.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,3 @@ Private = false
Modules = [ExtendableGrids]
Pages = ["commongrids.jl"]
```

1 change: 0 additions & 1 deletion docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@ Markdown.parse("""
$(read("../../README.md",String))
""")
````

1 change: 0 additions & 1 deletion docs/src/more.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@
Modules = [ExtendableGrids]
Pages = ["derived.jl","more.jl"]
```

1 change: 0 additions & 1 deletion docs/src/refinement.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@
Modules = [ExtendableGrids]
Pages = ["meshrefinements.jl","adaptive_meshrefinements.jl"]
```

1 change: 0 additions & 1 deletion docs/src/regionedit.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,3 @@ bfacemask!
rect!
bedgemask!
```

2 changes: 0 additions & 2 deletions docs/src/shape_specs.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,3 @@
Modules = [ExtendableGrids]
Pages = ["shape_specs.jl"]
```


1 change: 0 additions & 1 deletion docs/src/subgrid.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,3 @@ println(subv)
Modules = [ExtendableGrids]
Pages = ["subgrid.jl"]
```

1 change: 0 additions & 1 deletion docs/src/tdict.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,3 @@ See above ...
#### Cons
- Implemented using a Dict, so access is inherently slower than access to a component
of a struct. Therefore it is not well suited for inner loops.

2 changes: 0 additions & 2 deletions docs/src/tokenstream.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,3 @@ reading of tokenizable ASCII files
Modules = [ExtendableGrids]
Pages = ["tokenstream.jl"]
```


1 change: 0 additions & 1 deletion docs/src/voronoi.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@
Modules = [ExtendableGrids]
Pages = ["voronoi.jl"]
```

1 change: 0 additions & 1 deletion examples/experimental/adjacency.jl
Original file line number Diff line number Diff line change
Expand Up @@ -200,4 +200,3 @@ function test_adj_performance(n=100_000)
"""
nothing
end

2 changes: 1 addition & 1 deletion examples/vtk_write.jl
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ function grid1D_test(filename::String)
writeVTK(filename::String, g, true; point_data = point_data,
cell_data = cell_data,
field_data = field_data)
end
end
1 change: 0 additions & 1 deletion src/assemblytypes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,3 @@ GridComponentGeometries4AssemblyType(AT::Type{<:AssemblyType}) = GridComponent4T
GridComponentUniqueGeometries4AssemblyType(AT::Type{<:AssemblyType}) = GridComponent4TypeProperty(ItemType4AssemblyType(AT),PROPERTY_UNIQUEGEOMETRY)
GridComponentRegions4AssemblyType(AT::Type{<:AssemblyType}) = GridComponent4TypeProperty(ItemType4AssemblyType(AT),PROPERTY_REGION)
GridComponentAssemblyGroups4AssemblyType(AT::Type{<:AssemblyType}) = GridComponent4TypeProperty(ItemType4AssemblyType(AT),PROPERTY_ASSEMBLYGROUP)

1 change: 0 additions & 1 deletion src/commongrids.jl
Original file line number Diff line number Diff line change
Expand Up @@ -252,4 +252,3 @@ function ringsector(rad,ang; eltype=Triangle2D)
end
simplexgrid(coord,cells,cellregions,bfaces,bfaceregions)
end

2 changes: 1 addition & 1 deletion src/deprecated.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ export NodeInParent
function ExtendableGrids.instantiate(xgrid::ExtendableGrid, ::Type{NodeInParent})
@warn "NodeInParents is deprecated, use NodeParents instead"
xgrid[NodeParents]
end
end
2 changes: 1 addition & 1 deletion src/derived.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1347,4 +1347,4 @@ function ExtendableGrids.instantiate(xgrid::ExtendableGrid{Tc,Ti}, ::Type{BEdgeA
append!(xGeometryGroups, findall(==(EG), xBEdgeGeometries))
end
xGeometryGroups
end
end
2 changes: 1 addition & 1 deletion src/serialadjacency.jl
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,4 @@ Append a column to adjacency.
"""
function Base.append!(adj::SerialVariableTargetAdjacency,len)
push!(adj.colstart,adj.colstart[end]+len)
end
end
3 changes: 0 additions & 3 deletions src/subgrid.jl
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,3 @@ $(TYPEDSIGNATURES)
Return size of vector view.
"""
Base.size(a::SubgridVectorView)=(size(a.node_in_parent,1),)



1 change: 0 additions & 1 deletion src/tokenstream.jl
Original file line number Diff line number Diff line change
Expand Up @@ -169,4 +169,3 @@ function trytoken(tks::TokenStream,expected::String)
end
return true
end

1 change: 0 additions & 1 deletion src/typehierarchy.jl
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,3 @@ function allsubtypes(TApex)
end
allsubtypes!(Type[],TApex)
end

6 changes: 0 additions & 6 deletions src/vectorofconstants.jl
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,3 @@ $(TYPEDSIGNATURES)
Shortcut for unique
"""
Base.unique(v::VectorOfConstants)=[v.val]






1 change: 0 additions & 1 deletion test/testbinned.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,3 @@ end
@test testbinning(rand(2, 10000))
@test testbinning(rand(3, 10))
@test testbinning(rand(3, 10000))

1 change: 0 additions & 1 deletion test/tritet.jl
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,3 @@ end
@test isa(prism(),ExtendableGrid)
@test isa(material_prism(),ExtendableGrid)
end

0 comments on commit ac041e2

Please sign in to comment.