Skip to content

Dart Fix not working #188

@juan-campuzano

Description

@juan-campuzano

Describe the error
Currently working on a very large monorepository and executed dart run dart_code_linter:metrics fix lib and got the following error.

Resolving dependencies in `/Users/juan-campuzano/Documents/projects/maxxcontrol`... 
Downloading packages... 
Got dependencies in `/Users/juan-campuzano/Documents/projects/maxxcontrol`.
Resolving dependencies in `/Users/juan-campuzano/Documents/projects/maxxcontrol`... 
Downloading packages... 
Got dependencies in `/Users/juan-campuzano/Documents/projects/maxxcontrol`.
⠹ Processing 337 file(s)... 0.3s
Fix result: fixed 4 out of 7 issues
⠸ Processing 337 file(s)... 12.6s
Fix result: fixed 0 out of 4 issues

Fix result: fixed 0 out of 17 issues
⠼ Processing 337 file(s)... 12.7s
Fix result: fixed 8 out of 46 issues
⠴ Processing 337 file(s)... 12.8sUnhandled exception:
RangeError (start): Invalid value: Not in inclusive range 0..60109: 60161
#0      RangeError.checkValidRange (dart:core/errors.dart:387:7)
#1      _StringBase.replaceRange (dart:core-patch/string_patch.dart:634:33)
#2      LintAnalyzer._analyzeAndFixFile (package:dart_code_linter/src/analyzers/lint_analyzer/lint_analyzer.dart:229:37)
#3      LintAnalyzer.runCliFix (package:dart_code_linter/src/analyzers/lint_analyzer/lint_analyzer.dart:146:39)
<asynchronous suspension>
#4      FixCommand.runCommand (package:dart_code_linter/src/cli/commands/fix_lints_command.dart:39:5)
<asynchronous suspension>
#5      CommandRunner.runCommand (package:args/command_runner.dart:212:13)
<asynchronous suspension>
#6      CliRunner.run (package:dart_code_linter/src/cli/cli_runner.dart:58:7)
<asynchronous suspension>
#7      main (file:///Users/juan-campuzano/.pub-cache/hosted/pub.dev/dart_code_linter-3.0.0/bin/metrics.dart:4:3)
<asynchronous suspension>

How ​​to replicate the bug
Step by step to reproduce the error:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. View error

Screen shots
N/A

Runtime environment

  • OS: MacOS 15.5
  • Browser: [chrome, safari, firefox]

Flutter Doctor:

[✓] Flutter (Channel stable, 3.35.2, on macOS 15.5 24F74 darwin-arm64, locale en-CO)
[!] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
[✓] Xcode - develop for iOS and macOS (Xcode 26.0)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.3)
[✓] VS Code (version 1.103.2)

Metadata

Metadata

Assignees

No one assigned

    Labels

    ErrorReport something not workingReview/PendingInitial stage of the issue to evaluate its approval

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions