Skip to content

Conversation

@f-allian
Copy link
Collaborator

@f-allian f-allian commented Oct 16, 2025

This pull request introduces several improvements to developer experience, code quality enforcement, and compatibility for the Causal Testing Framework. The most significant changes include the addition of pre-commit hooks for automated code checks, updates to documentation for contributing and code style, expanded Python version support, and enhancements to linter configuration for better flexibility and compatibility.

Developer tooling and automation:

  • Added .pre-commit-config.yaml to enable automated code quality checks (trailing whitespace, end-of-file fixes, YAML/TOML validation, black formatting, isort sorting, pylint analysis) via pre-commit hooks.
  • Updated CONTRIBUTING.md with detailed instructions for contributing, using pre-commit hooks, manual code quality checks, and compatibility testing with tox.

Python compatibility:

  • Expanded Python version support to include 3.13 in CI (.github/workflows/ci-tests.yaml) and documentation build (.readthedocs.yaml). [1] [2]
  • Updated README.md to reflect support for Python 3.10, 3.11, 3.12, and 3.13, and clarified OS recommendations. [1] [2]

Code style and linting:

  • Enhanced .pylintrc configuration: increased limits on arguments, attributes, locals, statements, and public methods; added more "good" variable names; improved handling for dynamically generated members and ignored classes; set Python version to 3.10; disabled deprecated options; and tailored checks for specific modules. [1] [2] [3] [4] [5] [6] [7] [8] [9]

Documentation updates:

  • Replaced and improved contributing documentation (CONTRIBUTING.md), and removed the old .github/CONTRIBUTING.md file for clarity and consistency. [1] [2]
  • Revised README.md for clearer project description, requirements, and citation details.

@f-allian f-allian requested a review from jmafoster1 October 16, 2025 09:00
@f-allian f-allian self-assigned this Oct 16, 2025
@f-allian f-allian added the enhancement New feature or request label Oct 16, 2025
@github-actions
Copy link

github-actions bot commented Oct 16, 2025

🦙 MegaLinter status: ✅ SUCCESS

Descriptor Linter Files Fixed Errors Elapsed time
✅ PYTHON black 33 0 0.97s
✅ PYTHON pylint 33 0 5.72s

See detailed report in MegaLinter reports

MegaLinter is graciously provided by OX Security

@codecov
Copy link

codecov bot commented Oct 16, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.28%. Comparing base (4f7b245) to head (204e58a).
⚠️ Report is 8 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #358   +/-   ##
=======================================
  Coverage   96.27%   96.28%           
=======================================
  Files          28       28           
  Lines        1584     1588    +4     
=======================================
+ Hits         1525     1529    +4     
  Misses         59       59           
Files with missing lines Coverage Δ
causal_testing/__main__.py 97.61% <100.00%> (+0.18%) ⬆️
...esting/estimation/abstract_regression_estimator.py 95.83% <100.00%> (ø)
...ausal_testing/estimation/cubic_spline_estimator.py 96.66% <100.00%> (ø)
causal_testing/estimation/effect_estimate.py 100.00% <ø> (ø)
...ausal_testing/estimation/experimental_estimator.py 100.00% <100.00%> (ø)
...stimation/genetic_programming_regression_fitter.py 98.86% <100.00%> (ø)
...ting/estimation/instrumental_variable_estimator.py 100.00% <ø> (ø)
causal_testing/estimation/ipcw_estimator.py 99.25% <100.00%> (ø)
..._testing/estimation/linear_regression_estimator.py 100.00% <100.00%> (ø)
...esting/estimation/logistic_regression_estimator.py 100.00% <100.00%> (ø)
... and 11 more

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8118cc4...204e58a. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@f-allian f-allian marked this pull request as ready for review October 17, 2025 09:32
# Pylint
- repo: local
hooks:
- id: pylint
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this block commits that aren't perfectly linted? I'm not sure I want this. Sometimes it takes a while to resolve and I need to commit something I know isn't right. I know you can disable checks, but I prefer not to have commits be blocked. Obviously if it can fix it itself, then that's fine, but if it's everything, then that could get annoying.

Copy link
Collaborator Author

@f-allian f-allian Oct 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jmafoster1 - no, pre-commit doesn't completely block anything from being committed, it fixes it instead. The workflow is like this: 1) your script(s) contain unlinted, unformatted code 2) you commit files naively or run manually run pre-commit before committing 3) pre-commit identifies and initially "blocks" commits due to the rules defined in the pre-commit config 4) pre-commit formats and lints it for you 5) you commit as normal.

To avoid it "blocking" your commit from the get-go, just run pre-commit run --all-files before committing.

Copy link
Collaborator

@jmafoster1 jmafoster1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @f-allian, this mostly looks good. Just a couple few suggestions...

f-allian and others added 4 commits October 17, 2025 11:19
Co-authored-by: Michael Foster <13611658+jmafoster1@users.noreply.github.com>
Co-authored-by: Michael Foster <13611658+jmafoster1@users.noreply.github.com>
@f-allian
Copy link
Collaborator Author

@jmafoster1 - thanks for the review - please see the revised changes

@f-allian f-allian requested a review from jmafoster1 October 17, 2025 10:33
@f-allian f-allian linked an issue Oct 17, 2025 that may be closed by this pull request
@f-allian f-allian merged commit eef4939 into main Oct 17, 2025
16 checks passed
@f-allian f-allian deleted the f-allian/forward-compatibility branch November 12, 2025 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for Python 3.13

3 participants