forked from eatvio/eatvio_app
ci(static-analisys): flutter code metrics added
This commit is contained in:
37
.gitea/workflows/build.yml
Normal file
37
.gitea/workflows/build.yml
Normal file
@@ -0,0 +1,37 @@
|
||||
name: Android Release
|
||||
|
||||
# 1
|
||||
on: [push, pull_request]
|
||||
|
||||
# 4
|
||||
jobs:
|
||||
# 5
|
||||
build:
|
||||
# 6
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
# 7
|
||||
steps:
|
||||
# 8
|
||||
- uses: actions/checkout@v3
|
||||
# 9
|
||||
- uses: actions/setup-java@v3
|
||||
with:
|
||||
distribution: "zulu"
|
||||
java-version: "12.x"
|
||||
# 10
|
||||
- uses: subosito/flutter-action@v2
|
||||
with:
|
||||
# 11
|
||||
flutter-version: "3.0.0"
|
||||
channel: "stable"
|
||||
# 12
|
||||
- name: Get dependencies
|
||||
run: flutter pub Get
|
||||
|
||||
- name: Run Code Metrics
|
||||
run: flutter pub run dart_code_metrics:metrics --reporter=github lib
|
||||
|
||||
# Runs a set of commands using the runners shell
|
||||
- name: Start release build
|
||||
run: flutter build appbundle
|
||||
22
analysis_options.yaml
Normal file
22
analysis_options.yaml
Normal file
@@ -0,0 +1,22 @@
|
||||
analyzer:
|
||||
plugins:
|
||||
- dart_code_metrics
|
||||
|
||||
dart_code_metrics:
|
||||
anti-patterns:
|
||||
- long-method
|
||||
- long-parameter-list
|
||||
metrics:
|
||||
cyclomatic-complexity: 20
|
||||
lines-of-executable-code: 50
|
||||
number-of-parameters: 4
|
||||
maximum-nesting-level: 5
|
||||
metrics-exclude:
|
||||
- test/**
|
||||
rules:
|
||||
- newline-before-return
|
||||
- no-boolean-literal-compare
|
||||
- no-empty-block
|
||||
- prefer-trailing-comma
|
||||
- prefer-conditional-expressions
|
||||
- no-equal-then-else
|
||||
@@ -25,6 +25,7 @@ dependencies:
|
||||
carousel_slider: ^4.2.1
|
||||
|
||||
dev_dependencies:
|
||||
dart_code_metrics: ^5.7.6
|
||||
flutter_test:
|
||||
sdk: flutter
|
||||
flutter:
|
||||
|
||||
Reference in New Issue
Block a user