Skip to content

fix(supabase_lints): enable lines_longer_than_80_chars and fix all violations - #1655

Merged
spydon merged 2 commits into
mainfrom
chore/lines-longer-than-80-chars
Aug 6, 2026
Merged

fix(supabase_lints): enable lines_longer_than_80_chars and fix all violations#1655
spydon merged 2 commits into
mainfrom
chore/lines-longer-than-80-chars

Conversation

@spydon

@spydon spydon commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Why

dart format never reflows comments and never splits string literals, so nothing enforced the 80-column limit outside of the code the formatter can break by itself. 440 over-long lines had accumulated across 109 files, and CodeRabbit was doing the enforcement by hand in review (it flagged two such lines on #1654).

Enabling the rule continues the ratcheting pattern packages/supabase_lints/lib/analysis_options.yaml already documents: turn a rule on once its violations are gone.

What

lines_longer_than_80_chars: true in the shared lint config (the Flutter variant includes it, so both are covered), plus the 440 fixes.

Category Count Treatment
Prose in /// / // blocks 281 + 59 Rewrapped at 80 columns, wording unchanged
Over-long string literals ~100 Split into adjacent literals (same value)
Doc code samples 12 Reformatted the way dart format would break the same code
Missing space after /// / // 4 Added, then wrapped
Other 4 See below

The four one-offs:

  • buildClientInfoHeader computes the encoded platform version into a local instead of interpolating a call chain that cannot fit on one line. Same output.
  • Two test(...) headers with a trailing closure moved their arguments onto separate lines.
  • One trailing // comment on a map entry moved above the entry.

Three doc samples were JavaScript left over from the ports (new RetryTimer(...), console.log(...), let) inside ```dart fences. They are Dart now.

Fenced code, markdown lists and tables, and {@template} macros were kept structurally intact rather than reflowed as prose.

String values are provably unchanged

Splitting a literal into adjacent literals is value-preserving only if the split points are the sole change, so that was checked mechanically rather than by eye: every string literal value in every touched file was parsed with package:analyzer before and after (adjacent literals collapsed the way the language does) and compared in order. The only file that reports a difference is client_info.dart, which is the deliberate refactor above.

A note on the rule

It tolerates a line whose overflow is a single unbreakable URI, verified with a probe file: a long 'http://…' literal is accepted, while an equally long literal without a URI is not. So URLs in comments and strings stay as they are, and no // ignore: comments were needed anywhere.

Testing

  • dart analyze packages examples: clean, zero violations
  • dart format --set-exit-if-changed packages examples: clean, so the wrapping is stable under the formatter
  • Passing suites: supabase_common, functions_client, realtime_client, storage_client, supabase, supabase_flutter, and the hermetic gotrue suites (including get_claims_test and jwk_test, whose JWT fixtures were split most aggressively, and the two restructured tests)
  • postgrest fails against my local stack both on this branch and on its base, and two identical runs of the same code disagree on which tests fail, so that suite is state-dependent locally. CI, which starts a fresh stack, is the arbiter there.

Summary by CodeRabbit

  • Documentation
    • Improved API, security, usage, and example documentation across authentication, database, realtime, storage, and client libraries.
    • Clarified server-only authentication administration guidance and sign-out event handling.
    • Reformatted lengthy comments, examples, messages, and test descriptions for improved readability and consistency.
    • Documented that each JSON isolate instance maintains one running isolate.
  • Bug Fixes
    • Improved platform-version metadata encoding while preserving spaces.
  • Chores
    • Enabled enforcement of an 80-character line-length limit.

@spydon
spydon requested a review from a team as a code owner August 6, 2026 07:56
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@spydon, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 9 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 419d0eb8-acaa-4d6a-9a78-c72fc5179ba5

📥 Commits

Reviewing files that changed from the base of the PR and between 8f9b82d and bf55f53.

📒 Files selected for processing (10)
  • examples/passkeys/integration_test/passkeys_test.dart
  • packages/gotrue/lib/src/gotrue_client.dart
  • packages/gotrue/lib/src/types/session.dart
  • packages/gotrue/test/get_claims_test.dart
  • packages/realtime_client/lib/src/realtime_channel.dart
  • packages/realtime_client/lib/src/realtime_client.dart
  • packages/realtime_client/lib/src/types.dart
  • packages/storage_client/lib/src/storage_file_api.dart
  • packages/supabase/lib/src/supabase_stream_builder.dart
  • packages/supabase_flutter/lib/src/supabase_auth.dart
📝 Walkthrough

Walkthrough

This PR reformats Dart documentation, comments, strings, examples, and test fixtures across examples and packages. It enables the lines_longer_than_80_chars lint rule. The PR does not change runtime behavior or public API declarations.

Changes

Documentation and formatting alignment

Layer / File(s) Summary
Examples and integration tests
examples/*
Documentation comments, diagnostic strings, status messages, and examples are reformatted.
Functions, Auth, PostgREST, Realtime, Storage, and Supabase packages
packages/functions_client/*, packages/gotrue/*, packages/postgrest/*, packages/realtime_client/*, packages/storage_client/*, packages/supabase/*
API documentation, error strings, examples, test descriptions, fixtures, and serialized strings are wrapped or reformatted.
Shared utilities and lint configuration
packages/supabase_common/*, packages/supabase_flutter/*, packages/supabase_lints/*, packages/yet_another_json_isolate/*
Shared fixtures and documentation are reformatted. The lines_longer_than_80_chars lint is enabled.

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

Possibly related PRs

Suggested reviewers: tr00d, vinzent03

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies enabling the lint rule and fixing the resulting violations, which matches the primary changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/lines-longer-than-80-chars

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.

@spydon spydon changed the title chore(supabase_lints): enable lines_longer_than_80_chars and fix all violations fix(supabase_lints): enable lines_longer_than_80_chars and fix all violations Aug 6, 2026

@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: 10

🤖 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 `@examples/passkeys/integration_test/passkeys_test.dart`:
- Around line 16-20: Update the explanatory comment in the passkey integration
test to describe the ceremony as a WebAuthn/authenticator prompt rather than a
“platform authenticator” prompt, while retaining the existing examples and
headless-testing explanation.

In `@packages/gotrue/lib/src/gotrue_client.dart`:
- Around line 1122-1124: Update the comment near the authentication error
handling so the explanations for ignored 401, 403, and 404 status codes remain
separate, with each status code’s rationale clearly delimited and readable.

In `@packages/gotrue/lib/src/types/session.dart`:
- Around line 87-88: Update the isExpired documentation comment to use matching
backtick delimiters around true, ensuring the inline code renders correctly in
generated API documentation.

In `@packages/realtime_client/lib/src/realtime_channel.dart`:
- Around line 888-892: Update the unsubscribe documentation comment near the
channel termination API by changing “use the a `receive` hook” to “use a
`receive` hook,” removing the extra article.

In `@packages/realtime_client/lib/src/realtime_client.dart`:
- Around line 162-163: Complete the [endPoint] documentation comment by closing
the parenthetical phrase after “inherited host & protocol” and clearly
describing the supported relative endpoint form, preserving the existing
examples and wording.
- Around line 196-197: Update the constructor documentation for reconnectAfterMs
to state that the default is the stepped backoff function returned by
RetryTimer.createRetryFunction(), replacing the ambiguous “stepped backoff off”
wording.

In `@packages/realtime_client/lib/src/types.dart`:
- Around line 62-63: Correct the duplicated wording in both error messages near
the visible fromString() validation messages: replace “can be can be passed”
with “can be passed” and add “the” before the backticked fromString() method,
preserving the rest of each message.

In `@packages/storage_client/lib/src/storage_file_api.dart`:
- Around line 208-209: Correct the documentation grammar in the comments near
the signed upload URL description and the transform API description: update the
wording to “can be used to upload files” and “[transform] downloads a
transformed variant,” respectively.

In `@packages/supabase_flutter/lib/src/supabase_auth.dart`:
- Around line 341-342: Update the documentation reference in the OAuth sign-in
comment to use the existing auth state stream member `onAuthStateChange` instead
of `onAuthStateChanged`, matching the subscription used by the implementation.

In `@packages/supabase/lib/src/supabase_stream_builder.dart`:
- Around line 215-216: Update the reconnect comment near _getPostgrestData() to
correct the sentence separation and describe the actual asynchronous behavior:
PostgREST data loading is started after realtime subscribe without awaiting
completion, so do not claim it finishes before the realtime connection.
🪄 Autofix

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: CHILL

Plan: Pro Plus

Run ID: c2cfe49e-5f4c-4eda-98a7-727c5fe36d1e

📥 Commits

Reviewing files that changed from the base of the PR and between 4344c34 and a37d87a.

📒 Files selected for processing (110)
  • examples/authentication/integration_test/authentication_test.dart
  • examples/authentication/lib/auth_repository.dart
  • examples/authentication/lib/main.dart
  • examples/authentication/lib/models.dart
  • examples/database_crud/integration_test/tasks_test.dart
  • examples/database_crud/lib/main.dart
  • examples/database_crud/lib/models.dart
  • examples/database_crud/lib/tasks_repository.dart
  • examples/edge_functions/integration_test/functions_test.dart
  • examples/edge_functions/integration_test/invoke_test.dart
  • examples/edge_functions/lib/functions_repository.dart
  • examples/edge_functions/lib/models.dart
  • examples/launcher/lib/launcher.dart
  • examples/passkeys/integration_test/passkeys_test.dart
  • examples/realtime_room/integration_test/room_test.dart
  • examples/realtime_room/lib/main.dart
  • examples/realtime_room/lib/models.dart
  • examples/realtime_room/lib/room_channel.dart
  • examples/realtime_room/lib/room_repository.dart
  • examples/storage_transforms/integration_test/storage_test.dart
  • examples/storage_transforms/lib/main.dart
  • examples/storage_transforms/lib/storage_repository.dart
  • packages/functions_client/lib/src/functions_client.dart
  • packages/functions_client/lib/src/types.dart
  • packages/functions_client/test/functions_dart_test.dart
  • packages/gotrue/lib/src/broadcast_stub.dart
  • packages/gotrue/lib/src/constants.dart
  • packages/gotrue/lib/src/fetch.dart
  • packages/gotrue/lib/src/gotrue_admin_api.dart
  • packages/gotrue/lib/src/gotrue_admin_oauth_api.dart
  • packages/gotrue/lib/src/gotrue_client.dart
  • packages/gotrue/lib/src/gotrue_mfa_api.dart
  • packages/gotrue/lib/src/gotrue_oauth_api.dart
  • packages/gotrue/lib/src/helper.dart
  • packages/gotrue/lib/src/types/auth_exception.dart
  • packages/gotrue/lib/src/types/auth_response.dart
  • packages/gotrue/lib/src/types/auth_state.dart
  • packages/gotrue/lib/src/types/jwt.dart
  • packages/gotrue/lib/src/types/mfa.dart
  • packages/gotrue/lib/src/types/session.dart
  • packages/gotrue/lib/src/types/types.dart
  • packages/gotrue/lib/src/types/user.dart
  • packages/gotrue/lib/src/types/user_attributes.dart
  • packages/gotrue/test/client_test.dart
  • packages/gotrue/test/custom_http_client.dart
  • packages/gotrue/test/custom_oauth_provider_test.dart
  • packages/gotrue/test/get_claims_test.dart
  • packages/gotrue/test/jwk_test.dart
  • packages/gotrue/test/otp_mock_test.dart
  • packages/gotrue/test/refresh_token_race_test.dart
  • packages/gotrue/test/src/set_session_test.dart
  • packages/gotrue/test/utils.dart
  • packages/postgrest/lib/src/postgrest.dart
  • packages/postgrest/lib/src/postgrest_builder.dart
  • packages/postgrest/lib/src/postgrest_filter_builder.dart
  • packages/postgrest/lib/src/postgrest_query_builder.dart
  • packages/postgrest/lib/src/postgrest_transform_builder.dart
  • packages/postgrest/lib/src/raw_postgrest_builder.dart
  • packages/postgrest/lib/src/response_postgrest_builder.dart
  • packages/postgrest/lib/src/types.dart
  • packages/postgrest/test/reset_helper.dart
  • packages/postgrest/test/retry_test.dart
  • packages/postgrest/test/stack_trace_test.dart
  • packages/postgrest/test/transforms_test.dart
  • packages/postgrest/test/upsert_test.dart
  • packages/realtime_client/lib/realtime_client.dart
  • packages/realtime_client/lib/src/realtime_channel.dart
  • packages/realtime_client/lib/src/realtime_client.dart
  • packages/realtime_client/lib/src/realtime_presence.dart
  • packages/realtime_client/lib/src/retry_timer.dart
  • packages/realtime_client/lib/src/transformers.dart
  • packages/realtime_client/lib/src/types.dart
  • packages/realtime_client/test/channel_test.dart
  • packages/realtime_client/test/mock_test.dart
  • packages/realtime_client/test/realtime_integration_test.dart
  • packages/realtime_client/test/serializer_test.dart
  • packages/realtime_client/test/socket_test.dart
  • packages/realtime_client/test/utils/realtime_test_utils.dart
  • packages/realtime_client/test/websocket_io_test.dart
  • packages/storage_client/lib/src/fetch.dart
  • packages/storage_client/lib/src/storage_client.dart
  • packages/storage_client/lib/src/storage_file_api.dart
  • packages/storage_client/lib/src/types.dart
  • packages/storage_client/lib/src/vector_client.dart
  • packages/storage_client/test/basic_test.dart
  • packages/storage_client/test/client_test.dart
  • packages/supabase/lib/src/remove_subscription_result.dart
  • packages/supabase/lib/src/supabase_client.dart
  • packages/supabase/lib/src/supabase_client_options.dart
  • packages/supabase/lib/src/supabase_query_schema.dart
  • packages/supabase/lib/src/supabase_stream_builder.dart
  • packages/supabase/test/client_test.dart
  • packages/supabase/test/mock_test.dart
  • packages/supabase/test/stream_integration_test.dart
  • packages/supabase/test/utilities_test.dart
  • packages/supabase/test/utils.dart
  • packages/supabase_common/lib/src/client_info.dart
  • packages/supabase_common/lib/src/testing/local_stack.dart
  • packages/supabase_common/test/base64url_test.dart
  • packages/supabase_flutter/lib/src/hot_restart_cleanup_web.dart
  • packages/supabase_flutter/lib/src/local_storage.dart
  • packages/supabase_flutter/lib/src/supabase.dart
  • packages/supabase_flutter/lib/src/supabase_auth.dart
  • packages/supabase_flutter/test/auth_test.dart
  • packages/supabase_flutter/test/debug_default_test.dart
  • packages/supabase_flutter/test/deep_link_test.dart
  • packages/supabase_flutter/test/storage_test.dart
  • packages/supabase_flutter/test/utils.dart
  • packages/supabase_lints/lib/analysis_options.yaml
  • packages/yet_another_json_isolate/lib/yet_another_json_isolate.dart

Comment thread examples/passkeys/integration_test/passkeys_test.dart Outdated
Comment thread packages/gotrue/lib/src/gotrue_client.dart Outdated
Comment thread packages/gotrue/lib/src/types/session.dart Outdated
Comment thread packages/realtime_client/lib/src/realtime_channel.dart
Comment thread packages/realtime_client/lib/src/realtime_client.dart Outdated
Comment thread packages/realtime_client/lib/src/realtime_client.dart Outdated
Comment thread packages/realtime_client/lib/src/types.dart Outdated
Comment thread packages/storage_client/lib/src/storage_file_api.dart Outdated
Comment thread packages/supabase_flutter/lib/src/supabase_auth.dart Outdated
Comment thread packages/supabase/lib/src/supabase_stream_builder.dart Outdated
…violations

`dart format` never reflows comments or splits string literals, so nothing
enforced the 80-column limit outside of code the formatter could break itself.
That let 440 over-long lines accumulate across 109 files, and CodeRabbit ended
up doing the enforcement by hand in review.

Enabling the lint continues the ratcheting pattern the shared config already
documents: turn a rule on once its violations are gone.

How the violations were fixed:

- Prose in `///` and `//` blocks is rewrapped at 80 columns with the wording
  unchanged. Fenced code, markdown lists and tables, and `{@template}` macros
  are left structurally intact.
- Over-long string literals are split into adjacent literals, so the value is
  unchanged. This was verified mechanically: every string literal value in
  every touched file was parsed with `package:analyzer` before and after and
  compared, and the only difference is the one deliberate change below.
- Doc samples that ran long were reformatted the way `dart format` would break
  the same code. Three of them were JavaScript left over from the ports
  (`new RetryTimer(...)`, `console.log`, `let`), and are now Dart.
- Comments that started with `///`/`//` immediately followed by text now have
  the conventional space, and one `///` comment on a local variable became a
  regular `//` comment.
- `buildClientInfoHeader` computes the encoded platform version into a local
  instead of interpolating a call chain too long to fit. Same output.
- Two `test(...)` headers with a trailing closure moved their arguments onto
  separate lines.

Note that the lint tolerates a line whose overflow is a single unbreakable URI,
so URLs in comments and in strings stay as they are.
@spydon
spydon force-pushed the chore/lines-longer-than-80-chars branch from a37d87a to 8f9b82d Compare August 6, 2026 08:16
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

DCM's `avoid-commented-out-code` fired on the JWT payload comment in
`get_claims_test.dart`: wrapping the JSON across two comment lines made the
fragment parse as code. It is prose now, and the Header/Payload/Signature
structure that the rewrap had flattened into one paragraph is back.

The rest are wording problems the rewrap surfaced, all of them pre-existing:

- `gotrue_client.dart`: the 401/403/404 explanations are three sentences again
  instead of one run-on line.
- `session.dart`: `'true`` had mismatched delimiters, so it did not render as
  inline code.
- `realtime_channel.dart`: "use the a `receive` hook" -> "use a `receive` hook".
- `realtime_client.dart`: the `[endPoint]` sentence had an unclosed parenthesis,
  and `reconnectAfterMs` claimed "Defaults to stepped backoff off" where the
  constructor actually defaults to `RetryTimer.createRetryFunction()`.
- `types.dart`: both `fromString` messages said "can be can be passed to
  `fromString()` method".
- `storage_file_api.dart`: "can be used upload files" -> "can be used to upload
  files", and "[transform] download a transformed variant" -> "downloads",
  in both places it appears.
- `supabase_auth.dart`: the doc pointed at `auth.onAuthStateChanged`, which does
  not exist; the member is `onAuthStateChange`.
- `supabase_stream_builder.dart`: the reconnect comment claimed the initial
  PostgREST load completes before the realtime connect, which the `unawaited`
  call after `subscribe()` does not establish. It now describes what the code
  does, including why the first subscribe is skipped.
- `passkeys_test.dart`: a security key is a roaming authenticator, so the prompt
  is no longer described as a platform authenticator prompt.

The two `types.dart` messages are the only runtime strings that change.
@spydon
spydon merged commit a08b657 into main Aug 6, 2026
41 checks passed
@spydon
spydon deleted the chore/lines-longer-than-80-chars branch August 6, 2026 08:56
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.

2 participants