analyze: 1774 constant_identifier_names in generated glyphs.g.dart and one use_null_aware_elements #1

Merged
agent merged 1 commit from fix/2135-analyzer-clean into master 2026-09-29 10:14:45 +03:00
Owner

Tracker: #2135

flutter analyze reported 1775 issues; it now reports "No issues found!".

  • tool/build_font.dart emits // ignore_for_file: constant_identifier_names at the top of the generated lib/src/glyphs.g.dart. The constants keep the upstream snake_case glyph names (GlyphsSolid.chevron_left), so the public API does not change.
  • The build spec uses a null-aware map element ('offsets': ?offsets), which fixes use_null_aware_elements.
  • lib/src/glyphs.g.dart was regenerated with dart run tool/build_font.dart. The only change is the two header lines.

Verification

  • All five lib/fonts/*.ttf files, assets/codepoints.json, assets/metadata.json, assets/offsets.json, lib/src/glyph_offsets.g.dart and tool/xmark_rendered.png came out of the rebuild with the same git blob hashes as 0570977 (git hash-object vs git rev-parse 0570977:<path>).
  • git archive HEAD → flutter pub get && flutter analyze: No issues found! flutter test: All tests passed.
  • Banlu master 9e801f4, built with its ../../glyphs override pointing at this branch: flutter analyze No issues found! (same result as with 0570977).

Head: 842cd49980

Tracker: [#2135](https://sak.swipelab.com/tasks/2135) `flutter analyze` reported 1775 issues; it now reports "No issues found!". - `tool/build_font.dart` emits `// ignore_for_file: constant_identifier_names` at the top of the generated `lib/src/glyphs.g.dart`. The constants keep the upstream snake_case glyph names (`GlyphsSolid.chevron_left`), so the public API does not change. - The build spec uses a null-aware map element (`'offsets': ?offsets`), which fixes `use_null_aware_elements`. - `lib/src/glyphs.g.dart` was regenerated with `dart run tool/build_font.dart`. The only change is the two header lines. Verification - All five `lib/fonts/*.ttf` files, `assets/codepoints.json`, `assets/metadata.json`, `assets/offsets.json`, `lib/src/glyph_offsets.g.dart` and `tool/xmark_rendered.png` came out of the rebuild with the same git blob hashes as 0570977 (`git hash-object` vs `git rev-parse 0570977:<path>`). - `git archive HEAD` → `flutter pub get && flutter analyze`: No issues found! `flutter test`: All tests passed. - Banlu master 9e801f4, built with its `../../glyphs` override pointing at this branch: `flutter analyze` No issues found! (same result as with 0570977). Head: 842cd4998024128f437f8df192b1e8f8fada031b
The generator emits `ignore_for_file: constant_identifier_names` into
lib/src/glyphs.g.dart: its constants carry the upstream snake_case glyph
names that consumers call, so the public API is unchanged. The build spec
uses a null-aware map element for the optional offsets.

lib/src/glyphs.g.dart is regenerated with `dart run tool/build_font.dart`;
every font, codepoints.json, metadata.json, offsets.json and
glyph_offsets.g.dart is byte-identical to 0570977.

Tracker: https://sak.swipelab.com/tasks/2135
agent approved these changes 2026-09-29 10:04:16 +03:00
agent left a comment

Approved for #2135. I checked head 842cd49980 against base 0570977dc8. The PR diff has the same hunks as git diff 0570977...842cd49: two files, +5/−1.

Gates (run on scratch git archive copies)

  • flutter analyze at 0570977 reports 1775 issues found: 1774 × constant_identifier_names in lib/src/glyphs.g.dart, plus tool/build_font.dart:118:13 • use_null_aware_elements. At 842cd49 it reports No issues found!. The result is the same with the analysis_options.yaml that pub get rewrites and with the committed one (--no-pub).
  • flutter test at 842cd49: 00:06 +1: All tests passed!
  • I ran dart run tool/build_font.dart at 842cd49 in scratch and it exited 0. Every regenerated artifact matches the 0570977 blob: the five lib/fonts/*.ttf, assets/codepoints.json, assets/metadata.json, assets/offsets.json, lib/src/glyph_offsets.g.dart and tool/xmark_rendered.png. The regenerated lib/src/glyphs.g.dart matches the committed 842cd49 blob (1c1d251). So the directive comes from the generator, and 'offsets': ?offsets behaves the same as the old if element in both passes: pass 1 and its measured offsets.json are identical.
  • Public API: the class/static const declaration lines of glyphs.g.dart hash the same at both commits (4aab9aa…, 2868 constants), and everything after the header is byte-identical. No constant is renamed.
  • Banlu master 9e801f4: scratch archive with glyphs resolved by its ../../glyphs override to 842cd49. flutter analyze reports No issues found!. Banlu uses 73 distinct glyph constants, snake_case ones among them. The control run against 0570977 also reports No issues found!.

Review. The ignore_for_file directive belongs in the generated file only, and the generator emits it there, which fixes the cause. The null-aware map element is equivalent to the old if element (Dart ≥3.8; the pubspec SDK is ^3.11.3). The diff adds no narrative comments and the commit message follows the rules. No findings.

Approved for [#2135](https://sak.swipelab.com/tasks/2135). I checked head 842cd4998024128f437f8df192b1e8f8fada031b against base 0570977dc88b74fb1e5d7a6030559f14155d2421. The PR diff has the same hunks as `git diff 0570977...842cd49`: two files, +5/−1. **Gates** (run on scratch `git archive` copies) - `flutter analyze` at 0570977 reports **1775 issues found**: 1774 × `constant_identifier_names` in `lib/src/glyphs.g.dart`, plus `tool/build_font.dart:118:13 • use_null_aware_elements`. At 842cd49 it reports **No issues found!**. The result is the same with the analysis_options.yaml that `pub get` rewrites and with the committed one (`--no-pub`). - `flutter test` at 842cd49: `00:06 +1: All tests passed!` - I ran `dart run tool/build_font.dart` at 842cd49 in scratch and it exited 0. Every regenerated artifact matches the 0570977 blob: the five `lib/fonts/*.ttf`, `assets/codepoints.json`, `assets/metadata.json`, `assets/offsets.json`, `lib/src/glyph_offsets.g.dart` and `tool/xmark_rendered.png`. The regenerated `lib/src/glyphs.g.dart` matches the committed 842cd49 blob (1c1d251). So the directive comes from the generator, and `'offsets': ?offsets` behaves the same as the old `if` element in both passes: pass 1 and its measured offsets.json are identical. - Public API: the `class`/`static const` declaration lines of `glyphs.g.dart` hash the same at both commits (4aab9aa…, 2868 constants), and everything after the header is byte-identical. No constant is renamed. - Banlu master 9e801f4: scratch archive with glyphs resolved by its `../../glyphs` override to 842cd49. `flutter analyze` reports **No issues found!**. Banlu uses 73 distinct glyph constants, snake_case ones among them. The control run against 0570977 also reports No issues found!. **Review.** The `ignore_for_file` directive belongs in the generated file only, and the generator emits it there, which fixes the cause. The null-aware map element is equivalent to the old `if` element (Dart ≥3.8; the pubspec SDK is ^3.11.3). The diff adds no narrative comments and the commit message follows the rules. No findings.
Collaborator

The PR is not merged. Review 177 approves 842cd49980, but the reviewer account agent has only read permission on agra/glyphs, so it cannot merge. POST /api/v1/repos/agra/glyphs/pulls/1/merge (merge-commit, PR title) returned HTTP 405 "User not allowed to merge PR", and Forgejo records the approval as non-official. An account with write access needs to merge this PR, or agent needs write access on agra/glyphs before it can merge.

The PR is not merged. Review 177 approves 842cd4998024128f437f8df192b1e8f8fada031b, but the reviewer account `agent` has only `read` permission on agra/glyphs, so it cannot merge. `POST /api/v1/repos/agra/glyphs/pulls/1/merge` (merge-commit, PR title) returned HTTP 405 "User not allowed to merge PR", and Forgejo records the approval as non-official. An account with write access needs to merge this PR, or `agent` needs write access on agra/glyphs before it can merge.
agent merged commit 460441c68b into master 2026-09-29 10:14:45 +03:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
agra/glyphs!1
No description provided.