Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 8 additions & 11 deletions .github/workflows/analysis-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
types: [published]

env:
FLUTTER_SDK_VERSION: "3.10.3"
FLUTTER_SDK_VERSION: "3.38"

permissions:
contents: read
Expand All @@ -28,36 +28,33 @@ jobs:
if: github.event.pull_request.draft == false

steps:
- uses: actions/checkout@b56e6a3d768b11aef1d4c73977caf6413c0d74c8 # v3
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1

- name: Cache dependencies
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
id: cache
with:
path: /opt/hostedtoolcache/flutter
key: ${{ runner.os }}-pubspec-${{ env.FLUTTER_SDK_VERSION }}-${{ hashFiles('**/pubspec.lock') }}

- uses: subosito/flutter-action@48cafc24713cca54bbe03cdc3a423187d413aafa # v2.10.0
- uses: subosito/flutter-action@fd55f4c5af5b953cc57a2be44cb082c8f6635e8e # v2.21.0
with:
flutter-version: ${{ env.FLUTTER_SDK_VERSION }}

- name: Verify formatting
run: dart format --output=none --set-exit-if-changed .

- name: Get dependencies
run: flutter pub get

- name: Verify formatting
run: dart format --output=none --set-exit-if-changed .

- name: Analyze project source
run: flutter analyze --no-pub --fatal-infos

- name: Analyze Dart Code Metrics
run: flutter pub run dart_code_metrics:metrics analyze lib --fatal-style --fatal-performance

- name: Run tests
run: flutter test test/main.dart --no-pub --coverage

- name: Upload Coveralls
uses: coverallsapp/github-action@67662d24394fd74bffcf7b462d1b432814159afd # 2.0.0
uses: coverallsapp/github-action@5cbfd81b66ca5d10c19b062c04de0199c215fb6e # v2.3.7
continue-on-error: true
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
*.swp
.DS_Store
.atom/
.build/
.buildlog/
.history
.svn/
.swiftpm/
migrate_working_dir/

# IntelliJ related
Expand Down
73 changes: 3 additions & 70 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,83 +5,16 @@ linter:
- avoid_classes_with_only_static_members
- avoid_types_on_closure_parameters
- cancel_subscriptions
# - discarded_futures
# - discarded_futures
- unnecessary_null_aware_operator_on_extension_on_nullable

dart_code_metrics:
metrics:
cyclomatic-complexity: 20
maximum-nesting-level: 5
number-of-arguments: 4
metrics-exclude:
- test/**
rules:
- always-remove-listener
- arguments-ordering:
child-last: true
- avoid-border-all
- avoid-cascade-after-if-null
- avoid-collection-methods-with-unrelated-types
- avoid-double-slash-imports
- avoid-duplicate-exports
- avoid-global-state
- avoid-missing-enum-constant-in-map
- avoid-nested-conditional-expressions:
acceptable-level: 2
- avoid-redundant-async
- avoid-returning-widgets
- avoid-shrink-wrap-in-lists
- avoid-throw-in-catch-block
- avoid-unnecessary-conditionals
- avoid-unnecessary-setstate
- avoid-unnecessary-type-assertions
- avoid-unnecessary-type-casts
- avoid-unrelated-type-assertions
- avoid-expanded-as-spacer
- avoid-wrapping-in-padding
- binary-expression-operand-order
- double-literal-format
# - format-comment:
# ignored-patterns:
# - ^coverage.*
# - member-ordering
- missing-test-assertion
- newline-before-return
- no-boolean-literal-compare
- no-equal-then-else
# - no-magic-number
- prefer-conditional-expressions
- prefer-correct-edge-insets-constructor
- prefer-correct-test-file-name:
exclude:
- lib/**
- bin/**
- "**/main.dart"
- prefer-enums-by-name
# - prefer-extracting-callbacks
- prefer-first
- prefer-immediate-return
- prefer-iterable-of
- prefer-last
- prefer-match-file-name:
exclude:
- test/**
# - prefer-moving-to-variable
- prefer-trailing-comma
- prefer-single-widget-per-file:
ignore-private-widgets: true
- use-setstate-synchronously
anti-patterns:
- long-parameter-list

analyzer:
plugins:
- dart_code_metrics

errors:
avoid_equals_and_hash_code_on_mutable_classes: ignore
public_member_api_docs: ignore
unused_element: ignore # See https://github.com/dart-lang/sdk/issues/49025
unused_element_parameter: ignore
comment_references: ignore

# Style decisions
always_put_required_named_parameters_first: ignore
Expand Down
Loading