Skip to content

Introduce FBT linter - closes #1387 - #1391

Merged
fizyk merged 1 commit into
mainfrom
issue-1387
Aug 4, 2026
Merged

Introduce FBT linter - closes #1387#1391
fizyk merged 1 commit into
mainfrom
issue-1387

Conversation

@fizyk

@fizyk fizyk commented Aug 3, 2026

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • Breaking Changes

    • Options after the database name in PostgreSQL factories and executors must now be supplied as keyword arguments.
    • Update integrations that pass these options positionally.
  • Bug Fixes

    • Improved asynchronous cursor configuration by using the correct autocommit argument handling.
  • Chores

    • Enabled additional linting checks to detect potentially confusing boolean positional arguments and improve code consistency.

@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 5c5b1950-d937-4693-a298-46038c510224

📥 Commits

Reviewing files that changed from the base of the PR and between 530607f and 440c911.

📒 Files selected for processing (11)
  • newsfragments/1387.break.1.rst
  • newsfragments/1387.break.2.rst
  • newsfragments/1387.break.rst
  • newsfragments/1387.misc.rst
  • pyproject.toml
  • pytest_postgresql/executor.py
  • pytest_postgresql/factories/noprocess.py
  • pytest_postgresql/factories/process.py
  • pytest_postgresql/janitor.py
  • tests/test_chaining.py
  • tests/test_janitor.py

📝 Walkthrough

Walkthrough

The PR makes selected PostgreSQL APIs and test helpers keyword-only, updates asynchronous autocommit handling, enables Ruff’s FBT rule, and adds release-note fragments.

Changes

API and lint updates

Layer / File(s) Summary
Keyword-only API signatures
pytest_postgresql/executor.py, pytest_postgresql/factories/*.py, tests/test_chaining.py, newsfragments/1387.break*.rst
The executor, PostgreSQL factories, and chaining helpers require keyword arguments after their positional parameters. Release notes document the breaking changes.
Ruff FBT rule
pyproject.toml, newsfragments/1387.misc.rst
Ruff now enables the FBT rule. A news fragment records the change.
Keyworded autocommit call
pytest_postgresql/janitor.py, tests/test_janitor.py
The asynchronous cursor passes True through set_autocommit(value=True). The test expects this call shape.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related issues

Possibly related PRs

🚥 Pre-merge checks | ✅ 6
✅ Passed checks (6 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the introduction of the FBT linter, which is a central change in the pull request.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Newsfragment Check ✅ Passed Four newsfragments were added under newsfragments/: three break fragments and one misc fragment; both types are valid in pyproject.toml.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch issue-1387

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Aug 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@newsfragments/1387.break.rst`:
- Around line 1-2: Rewrite the content of newsfragment 1387.break.rst as a clear
migration note explaining that the postgresql_noproc and postgresql_proc
factories now partially require keyword arguments, explicitly identifying
options as the first affected argument. Preserve the existing filename and
break-newsfragment type.

In `@newsfragments/1387.misc.rst`:
- Around line 1-3: Rewrite the news fragment to clearly state that the Ruff FBT
(flake8-boolean-trap) rules were enabled, using direct changelog wording and
preserving the existing documentation link.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 1e803fce-8e15-4449-bddb-4c64d11649a4

📥 Commits

Reviewing files that changed from the base of the PR and between 36f83fd and 5baa716.

📒 Files selected for processing (9)
  • newsfragments/1387.break.rst
  • newsfragments/1387.misc.rst
  • pyproject.toml
  • pytest_postgresql/executor.py
  • pytest_postgresql/factories/noprocess.py
  • pytest_postgresql/factories/process.py
  • pytest_postgresql/janitor.py
  • tests/test_chaining.py
  • tests/test_janitor.py

Comment thread newsfragments/1387.break.rst Outdated
Comment thread newsfragments/1387.misc.rst Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@newsfragments/1387.break.2.rst`:
- Around line 1-3: Update the migration note for postgresql_noproc to remove
startparams, unixsocketdir, and postgres_options, leaving only options, load,
load_autocommit, and depends_on as affected parameters.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 66bc13e0-a7e6-4f5d-b300-96c47a3f70a9

📥 Commits

Reviewing files that changed from the base of the PR and between 5baa716 and 530607f.

📒 Files selected for processing (11)
  • newsfragments/1387.break.1.rst
  • newsfragments/1387.break.2.rst
  • newsfragments/1387.break.rst
  • newsfragments/1387.misc.rst
  • pyproject.toml
  • pytest_postgresql/executor.py
  • pytest_postgresql/factories/noprocess.py
  • pytest_postgresql/factories/process.py
  • pytest_postgresql/janitor.py
  • tests/test_chaining.py
  • tests/test_janitor.py

Comment thread newsfragments/1387.break.2.rst Outdated
@fizyk
fizyk merged commit 703bdc1 into main Aug 4, 2026
72 checks passed
@fizyk
fizyk deleted the issue-1387 branch August 4, 2026 08:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant