Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -279,11 +279,10 @@ jobs:
run: uv python install 3.12
- name: Install dependencies
run: uv sync --locked --all-groups --all-extras
- name: Fetch pull request base for the new-duplicate check
if: github.event_name == 'pull_request' || github.event_name == 'merge_group'
run: git fetch --no-tags --depth=1 origin "$BASE_SHA"
- name: Fetch the base for the new-duplicate check
run: git fetch --no-tags --depth=1 origin "$BASE_REF"
env:
BASE_SHA: ${{ github.event.pull_request.base.sha || github.event.merge_group.base_sha }}
BASE_REF: ${{ github.event.pull_request.base.sha || github.event.merge_group.base_sha || 'main:refs/remotes/origin/main' }}
- name: Run static checks
run: make check-ci
env:
Expand Down
14 changes: 5 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -562,20 +562,16 @@ dupes:
uv run fensu dupes


# Warn mode: report new duplicated code since DUPES_BASE without failing the build.
# Fails on duplicated code new since DUPES_BASE. A missing base fails too, so the check cannot
# silently disappear.
DUPES_BASE ?= origin/main

check-dupes-new:
@if ! git rev-parse --verify --quiet "$(DUPES_BASE)^{commit}" >/dev/null; then \
echo "warning: skipped new-duplicate check: base $(DUPES_BASE) is not available"; \
exit 0; \
echo "error: new-duplicate check needs base $(DUPES_BASE); fetch it or set DUPES_BASE" >&2; \
exit 2; \
fi; \
uv run fensu dupes --since "$(DUPES_BASE)" --fail-on-new; rc=$$?; \
if [ $$rc -eq 1 ]; then \
echo "warning: new duplicated code above (warn mode: this check does not fail yet)"; \
elif [ $$rc -ne 0 ]; then \
exit $$rc; \
fi
uv run fensu dupes --since "$(DUPES_BASE)" --fail-on-new


check:
Expand Down
3 changes: 1 addition & 2 deletions fensu.toml
Original file line number Diff line number Diff line change
Expand Up @@ -1540,8 +1540,7 @@ rule_modules = [
"scripts.fensu_policy.rules.native_boundary",
"scripts.fensu_policy.rules.unused_state",
]
select = ["FPRS", "XSB072", "XSB073", "XSB075"]
warn = ["XSB076", "XSB077"]
select = ["FPRS", "XSB072", "XSB073", "XSB075", "XSB076", "XSB077"]

[targets.rust.rule_options.XSB076]
schema_paths = ["crates/sqlbuild-orchestration/src/store"]
Expand Down
Loading