Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: custom linting (more than 80 lines for formatting) #21

Closed
tomassasovsky opened this issue Apr 3, 2022 · 7 comments · Fixed by #114
Closed

feat: custom linting (more than 80 lines for formatting) #21

tomassasovsky opened this issue Apr 3, 2022 · 7 comments · Fixed by #114
Assignees
Labels
feature A new feature or request

Comments

@tomassasovsky
Copy link

It would be nice for the build not to fail if the code is not formatted like the Dart linter suggests.

Is there any way to change this?

@tomassasovsky tomassasovsky added the bug Something isn't working as expected label Apr 3, 2022
@wolfenrain wolfenrain added feature A new feature or request and removed bug Something isn't working as expected labels Apr 7, 2022
@wolfenrain
Copy link
Member

While I personally would not recommend it, as Dart and the IDE tooling for the language always come with the 80 char line rule, I do see the added value for companies that have their own configuration for this.

Sadly there is currently no way to do this using the analysis_options.yaml file. But the flutter format command does expose a --line-length int flag. So we could add a --line-length ${{inputs.line_length}} flag to the step.?

What do you think @felangel?

@Luckey-Elijah
Copy link
Contributor

Would greatly appreciate a feature to allow a custom line length passed to the dart/flutter format command. Something like:

jobs:
  verify_and_test:
    name: Verify and Test
    uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/dart_package.yml@v1
    with:
      working_directory: packages/my_package
      line_length: 100 # adding this option
      min_coverage: 100

@Luckey-Elijah
Copy link
Contributor

I forked and added the feature. My branch seems to serve me well in my private project.
feat/add-line-length-to-workflow.

@DFelten
Copy link

DFelten commented Jul 24, 2022

We're also using an other line length. Our default is 120 and so we're excluding generated files from formatting.

Our formatting command is:

find . -name "*.dart" ! -name "*.freezed.dart" ! -name "*.config.dart" ! -name "*.g.dart" ! -path '*/generated/*' | tr '\n' ' ' | xargs flutter format -l 120 --set-exit-if-changed

Maybe something like this could also be added as an option?

@jxstxn1
Copy link

jxstxn1 commented Apr 19, 2023

Any update on this issue?

@renancaraujo
Copy link
Contributor

@jxstxn1 on pr now #114 114

@jxstxn1
Copy link

jxstxn1 commented May 15, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A new feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants