Skip to content

feat: Use package formatter configuration for line length #329

@erickzanardo

Description

@erickzanardo

Description

Right now the workflows that check dart projects (Flutter package, dart package, etc) explicitly passes a --line-length to the dart format command.

Since dart 3.7 the line length can be configure in the analysis_options.

By explicitly passing that flag, the package configuration will always be overridden, cause redundancies in projects that has a custom line limit.

I suggest that we remove the default of that field in the action, and only explicitly pass the flag if the user informed a value for it.

This should not cause any breaking changes because when a line-length flag is omitted, the default is 80 which is already what we have configured in the actions.

If we want to be super backward compatibility with older darts, we can also add a checking on the dart version and if it is lower than 3.7, the flag continues to be explicitly added

Requirements

  • All CI/CD checks are passing.
  • There is no drop in the test coverage percentage.
  • The line-length field in the actions will only be added to the command when the user pass something in that field.

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureA new feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions