From 3c0bb719a716781ed4b0dafa585c79a005ef185e Mon Sep 17 00:00:00 2001 From: Ashley Stewart Date: Thu, 5 Mar 2026 16:03:28 +1000 Subject: [PATCH 1/7] Add Codecov configuration for PR coverage reporting Configures coverage status checks (project and patch) and PR comments so coverage impact is visible directly on pull requests. --- codecov.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 codecov.yml diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 0000000..2fd361f --- /dev/null +++ b/codecov.yml @@ -0,0 +1,13 @@ +coverage: + status: + project: + default: + target: auto + threshold: 1% + patch: + default: + target: 80% + +comment: + layout: "condensed_header, diff, flags, components" + require_changes: true From 32ae9baaf071ff7226473cf1096bac6871b4d539 Mon Sep 17 00:00:00 2001 From: Ashley Stewart Date: Thu, 5 Mar 2026 16:09:37 +1000 Subject: [PATCH 2/7] Set project coverage target to 80% --- codecov.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/codecov.yml b/codecov.yml index 2fd361f..b586953 100644 --- a/codecov.yml +++ b/codecov.yml @@ -2,8 +2,7 @@ coverage: status: project: default: - target: auto - threshold: 1% + target: 80% patch: default: target: 80% From d8b032e9962dfb378471d95a6bfcb9bbf2772a61 Mon Sep 17 00:00:00 2001 From: Ashley Stewart Date: Thu, 5 Mar 2026 16:24:27 +1000 Subject: [PATCH 3/7] Exclude legacy test_bids_validator.py from coverage reporting This file is a legacy test in the source tree that requires datalad datasets at import time and is never executed as part of the test suite. Excluding it gives a more accurate coverage measurement. --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 90d1a39..e79e6ca 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -77,6 +77,7 @@ source = ["bids_validator", "tests"] omit = [ "setup.py", "*/_version.py", + "*/test_bids_validator.py", ] [tool.coverage.paths] From 982a6ca0e5b16180e97554fb756c70389420a69e Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Thu, 5 Mar 2026 13:43:54 -0500 Subject: [PATCH 4/7] Run and check coverage of in-tree tests --- pyproject.toml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index e79e6ca..bbfa6e8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -62,7 +62,7 @@ parentdir_prefix = "" [tool.pytest.ini_options] minversion = "6" -testpaths = ["tests"] +testpaths = ["src", "tests"] log_level = "INFO" xfail_strict = true addopts = ["-ra", "--strict-config", "--strict-markers"] @@ -73,11 +73,10 @@ doctest_optionflags = ["NORMALIZE_WHITESPACE", "IGNORE_EXCEPTION_DETAIL"] [tool.coverage.run] branch = true parallel = true -source = ["bids_validator", "tests"] +source = ["src", "tests"] omit = [ "setup.py", "*/_version.py", - "*/test_bids_validator.py", ] [tool.coverage.paths] From 06bf2a2dba3480b6193a85c4387e8caa59bcaeb6 Mon Sep 17 00:00:00 2001 From: "Christopher J. Markiewicz" Date: Thu, 5 Mar 2026 14:38:10 -0500 Subject: [PATCH 5/7] chore(ci): Do not run on pushes to feature branches --- .github/workflows/build-test-deploy.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-test-deploy.yml b/.github/workflows/build-test-deploy.yml index 7337aca..6ccc166 100644 --- a/.github/workflows/build-test-deploy.yml +++ b/.github/workflows/build-test-deploy.yml @@ -1,7 +1,12 @@ on: push: + branches: + - main + - maint/* pull_request: - branches: [main] + branches: + - main + - maint/* release: types: - published From 830cd5d2384453ef0d3864a6c667b1913cd90bc1 Mon Sep 17 00:00:00 2001 From: "Christopher J. Markiewicz" Date: Thu, 5 Mar 2026 15:19:45 -0500 Subject: [PATCH 6/7] chore: Filter some warnings --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index bbfa6e8..26eb474 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -66,7 +66,7 @@ testpaths = ["src", "tests"] log_level = "INFO" xfail_strict = true addopts = ["-ra", "--strict-config", "--strict-markers"] -filterwarnings = ["error"] +filterwarnings = ["error", "ignore::pytest.PytestUnraisableExceptionWarning", "ignore::SyntaxWarning:datalad*"] norecursedirs = ["data"] doctest_optionflags = ["NORMALIZE_WHITESPACE", "IGNORE_EXCEPTION_DETAIL"] From 804f8c500b251cbbf6ca4f384f9eca31fcac14c8 Mon Sep 17 00:00:00 2001 From: "Christopher J. Markiewicz" Date: Thu, 5 Mar 2026 15:23:12 -0500 Subject: [PATCH 7/7] chore: Avoid datalad error --- tox.ini | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tox.ini b/tox.ini index 9dcdad2..639b7a9 100644 --- a/tox.ini +++ b/tox.ini @@ -60,6 +60,8 @@ deps = pre: git+https://github.com/bids-standard/bids-specification.git\#subdirectory=tools/schemacode commands = + # Avoid SyntaxWarning being promoted to SyntaxError in Python 3.14, Datalad up to 1.3.2. + python -c 'import datalad' coverage erase coverage run -p -m bids_validator tests/data/bids-examples/ds000117 python -m pytest --doctest-modules --cov . --cov-append --cov-report term \