github-actions-analyze-dart icon indicating copy to clipboard operation
github-actions-analyze-dart copied to clipboard

How to turn off Invalid Warning check?

Open brodienguyen opened this issue 2 years ago • 7 comments

Hi there,

Please let me know if there is a way to skip this warning message. Btw, I wonder why it raises for those import lines, please? image

Regards, Brodie

brodienguyen avatar Jan 21 '23 13:01 brodienguyen

We got something similar:

image

simplenotezy avatar Nov 06 '23 17:11 simplenotezy

@zgosalvez would love to hear if you got a workaround

simplenotezy avatar Nov 06 '23 17:11 simplenotezy

This is our workflow btw:

name: Run checks

on:
  pull_request:
    types:
      - opened
      - reopened
      - synchronize
      - ready_for_review
env:
  FLUTTER_VERSION: "3.13.9"
  FLUTTER_CHANNEL: "stable"
  
jobs:
  build:
    name: Run checks
    runs-on: ubuntu-latest
    if: ${{ github.event.pull_request.draft == false }}
    steps:
      - name: Checkout code
        uses: actions/checkout@v2
        
      - name: Set up Flutter
        uses: subosito/[email protected]
        with:
          flutter-version: ${{ env.FLUTTER_VERSION }}
          channel: ${{ env.FLUTTER_CHANNEL }}
          architecture: x64
          cache: true

      - name: Create .env
        run: echo "WHY_CANNOT_I_BE_EMPTY" > .env
      
      - run: |
          flutter pub get
          flutter pub run build_runner build --delete-conflicting-outputs

      - name: Analyze Dart
        uses: zgosalvez/github-actions-analyze-dart@v3
        with:
          line-length: 150
          fail-on-warnings: true
          fail-on-infos: false

simplenotezy avatar Nov 06 '23 17:11 simplenotezy

Perhaps it could be because line-length is not respected?

simplenotezy avatar Nov 06 '23 17:11 simplenotezy

I'm curious to know why you'd like to turn off warnings. By design, this action is informative based on the output reported by Dart. By default, this action won't fail anyway since fail-on-warnings is false.

zgosalvez avatar Dec 03 '23 02:12 zgosalvez

@brodienguyen / @simplenotezy, care to verify if the PR will resolve your issue? If so, I will merge the changes.

zgosalvez avatar Apr 09 '24 03:04 zgosalvez

@brodienguyen / @simplenotezy, care to verify if the PR will resolve your issue? If so, I will merge the changes.

@zgosalvez Hi, Thank you very much for providing this great Action first!

This PR([#96) is useful because generated files doesn't and shouldn't be formatted with dart format, e,g, g.dart by json_serializable.

These files also configured to be excluded in analysis_options.yaml normally in projects.

I'm also feel confused by these warnings thrown from my *.g.dart files (generate by flutter gen-l10n, these files won't follow role defined by flutter_lints or linter option in analysis_options.yaml).

image

FriesI23 avatar Apr 18 '24 11:04 FriesI23