diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b068313..42b329b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -14,9 +14,8 @@ repos: rev: v5.0.2 hooks: - id: reuse-lint-file -- repo: https://github.com/compilerla/conventional-pre-commit - rev: v3.4.0 +- repo: https://github.com/crate-ci/committed + rev: v1.1.7 hooks: - - id: conventional-pre-commit + - id: committed stages: [commit-msg] - args: [] diff --git a/.woodpecker/check_formatting.yaml b/.woodpecker/check_formatting.yaml index ae15e67..358faff 100644 --- a/.woodpecker/check_formatting.yaml +++ b/.woodpecker/check_formatting.yaml @@ -9,6 +9,8 @@ steps: RUST_BACKTRACE: 1 CARGO_TERM_COLOR: always commands: + - cargo install committed + - committed develop..HEAD - rustup component add rustfmt - cargo fmt --all -- --check when: diff --git a/committed.toml b/committed.toml new file mode 100644 index 0000000..7012cd9 --- /dev/null +++ b/committed.toml @@ -0,0 +1,73 @@ +# SPDX-FileCopyrightText: 2025 Topola contributors +# +# SPDX-License-Identifier: MIT + +subject_length = 80 +line_length = 100 +style = "conventional" + +# Should be the same as the list of directories in crates/ and src/. +allowed_scopes = [ + # Generated using `ls crates | awk '{ print "\"" $1 "\","; }' | sort`. + "planar-incr-embed", + "specctra-core", + "specctra_derive", + "topola-cli", + "topola-egui", + + # Generated using + # `find src -type f | awk '!/lib.rs|mod.rs/ { print "\"" substr($1, 1 + 4, length($1) - 4 - 3) "\","; }' | sort`. + "autorouter/autoroute", + "autorouter/autorouter", + "autorouter/compare_detours", + "autorouter/execution", + "autorouter/history", + "autorouter/invoker", + "autorouter/measure_length", + "autorouter/place_via", + "autorouter/pointroute", + "autorouter/ratsnest", + "autorouter/remove_bands", + "autorouter/selection", + "drawing/band", + "drawing/bend", + "drawing/cane", + "drawing/collect", + "drawing/dot", + "drawing/drawing", + "drawing/gear", + "drawing/graph", + "drawing/guide", + "drawing/head", + "drawing/loose", + "drawing/primitive", + "drawing/seg", + "geometry/compound", + "geometry/edit", + "geometry/geometry", + "geometry/poly", + "geometry/primitive", + "geometry/recording_with_rtree", + "geometry/shape", + "geometry/with_rtree", + "graph", + "interactor/activity", + "interactor/interaction", + "interactor/interactor", + "layout/layout", + "layout/poly", + "layout/via", + "math/tangents", + "router/astar", + "router/draw", + "router/navcord", + "router/navcorder", + "router/navmesh", + "router/route", + "router/router", + "specctra/design", + "stepper", + "triangulation" +] + +merge_commit = false