chore(lint): LeanCode's strict rules and a pre-push check
The workspace root's analysis_options.yaml includes leancode_lint 27 and enables its analyzer plugin (rules for blocs, Equatable and Flutter layout); the server and the app include that file, while the generated client keeps its own options. Plugins can only be enabled at the root of a pub workspace and only reach packages whose options include the root file, which was verified before settling on this layout. Most rules are warnings, casts, inference and raw types are strict, and the check treats infos as fatal too. lints and flutter_lints are no longer needed.
tool/check.sh checks formatting, runs dart analyze --fatal-infos and the server tests; .git/hooks/pre-push links to it, so every push has to pass it. AGENTS.md describes the checklist and how to install the hook in a fresh clone.
Fixes for the new rules: package imports, run() returns Future<void>, the server setup as one cascade, a primary constructor for the app widget, a const and a redundant argument. The workspace root keeps its conventional name `_` with a documented ignore.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
2026-09-29 23:06:29 +02:00
|
|
|
# The workspace's lint rules (see ../analysis_options.yaml), minus generated code.
|
|
|
|
|
include: ../analysis_options.yaml
|
2026-09-16 19:24:59 +02:00
|
|
|
|
|
|
|
|
analyzer:
|
|
|
|
|
exclude:
|
|
|
|
|
- lib/src/generated/**
|
|
|
|
|
- test/integration/test_tools/serverpod_test_tools.dart
|
|
|
|
|
|
build: Serverpod v4.0.3
Moves every Serverpod package, and the four overrides for serverpod_offline_sync, from v4.0.2 to v4.0.3 before the first synced table's migration exists, so that migration is created on the version that stays.
v4.0.3 contains fixes only. Checked before moving: serverpod_database gained only backwards-compatible changes, none of which the sync package calls into. Server-side session keys are hashed as before (the cheaper argon2 applies to JWT refresh tokens, which we don't use), so no session ends. The auth module's profile image relation is now deferred, which fixes restoring a Postgres dump; step 7's migration carries that change.
argon2 now runs in serverpod_argon2 (BSD-3), a new dependency of the server only: a prebuilt, statically linked library that needs no glibc, bundled by dart build cli like the SQLite libraries, so the Docker build is unchanged. It doesn't reach the app.
The code generator still fails on Dart v3.13's primary constructors in endpoint files (tried again), so the server keeps the four syntax lints off. The regenerated test tools gain withServerpod's ephemeralDatabase option.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
2026-09-30 10:42:34 +02:00
|
|
|
# Serverpod's code generator reads this package with an analyzer that doesn't know
|
|
|
|
|
# Dart v3.13's primary constructors yet, and fails on them in endpoint files ("requires
|
|
|
|
|
# the 'primary-constructors' language feature"; checked again with v4.0.3). So the
|
|
|
|
|
# server keeps the classic constructor and class-body syntax; switch these back on once
|
|
|
|
|
# Serverpod parses it.
|
2026-09-30 09:03:52 +02:00
|
|
|
linter:
|
|
|
|
|
rules:
|
|
|
|
|
empty_container_bodies: false
|
|
|
|
|
unnecessary_type_name_in_constructor: false
|
|
|
|
|
use_declaring_parameters: false
|
|
|
|
|
use_primary_constructors: false
|
|
|
|
|
|
2026-09-16 19:24:59 +02:00
|
|
|
formatter:
|
|
|
|
|
trailing_commas: preserve
|