From c30769a97c500fcad4a2fd72fdca7b257d7d7ba0 Mon Sep 17 00:00:00 2001 From: Anatoliy Poloz Date: Tue, 27 Feb 2024 11:37:46 +0300 Subject: [PATCH 01/31] ci(static-analisys): flutter code metrics added --- .gitea/workflows/build.yml | 37 +++++++++++++++++++++++++++++++++++++ analysis_options.yaml | 22 ++++++++++++++++++++++ pubspec.yaml | 1 + 3 files changed, 60 insertions(+) create mode 100644 .gitea/workflows/build.yml create mode 100644 analysis_options.yaml diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml new file mode 100644 index 00000000..6e7e79d4 --- /dev/null +++ b/.gitea/workflows/build.yml @@ -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 diff --git a/analysis_options.yaml b/analysis_options.yaml new file mode 100644 index 00000000..72788038 --- /dev/null +++ b/analysis_options.yaml @@ -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 diff --git a/pubspec.yaml b/pubspec.yaml index 5bc2b5fc..bc447661 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -25,6 +25,7 @@ dependencies: carousel_slider: ^4.2.1 dev_dependencies: + dart_code_metrics: ^5.7.6 flutter_test: sdk: flutter flutter: From 55ceb953d82834f9ab5ba79daae5a2281e642763 Mon Sep 17 00:00:00 2001 From: Anatoliy Poloz Date: Tue, 27 Feb 2024 11:39:23 +0300 Subject: [PATCH 02/31] fix(ci): currected of action url --- .gitea/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 6e7e79d4..3acb777a 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -20,7 +20,7 @@ jobs: distribution: "zulu" java-version: "12.x" # 10 - - uses: subosito/flutter-action@v2 + - uses: actions/flutter-action@v2 with: # 11 flutter-version: "3.0.0" From 36d5f146f0776ac09c5ed0f2a036b4b4b11c3b2b Mon Sep 17 00:00:00 2001 From: apoloz Date: Tue, 27 Feb 2024 08:45:07 +0000 Subject: [PATCH 03/31] Update .gitea/workflows/build.yml --- .gitea/workflows/build.yml | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 3acb777a..32c47392 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -1,31 +1,25 @@ 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: actions/flutter-action@v2 with: - # 11 - flutter-version: "3.0.0" + flutter-version: "3.16.4" channel: "stable" - # 12 + - name: Get dependencies run: flutter pub Get From 6492bd2e213ae923f56d6eb39a4b941f8d5b9d2e Mon Sep 17 00:00:00 2001 From: apoloz Date: Tue, 27 Feb 2024 09:29:12 +0000 Subject: [PATCH 04/31] Update .gitea/workflows/build.yml --- .gitea/workflows/build.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 32c47392..685aad84 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -10,15 +10,16 @@ jobs: - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 - with: - distribution: "zulu" - java-version: "12.x" +# - uses: actions/setup-java@v3 +# with: +# distribution: "zulu" +# java-version: "12.x" - uses: actions/flutter-action@v2 with: flutter-version: "3.16.4" - channel: "stable" + channel: "any" + run: "flutter --version" - name: Get dependencies run: flutter pub Get From 403d982ac902035ab55177759c324e1e1cbf0224 Mon Sep 17 00:00:00 2001 From: apoloz Date: Tue, 27 Feb 2024 09:39:35 +0000 Subject: [PATCH 05/31] Update .gitea/workflows/build.yml --- .gitea/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 685aad84..fb98e4c7 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -17,8 +17,8 @@ jobs: - uses: actions/flutter-action@v2 with: - flutter-version: "3.16.4" - channel: "any" + flutter-version: '3.*' + channel: 'any' run: "flutter --version" - name: Get dependencies From 2ae4dd19f8ced276fae747e14f3845c7d7c11a37 Mon Sep 17 00:00:00 2001 From: apoloz Date: Tue, 27 Feb 2024 09:43:23 +0000 Subject: [PATCH 06/31] Update .gitea/workflows/build.yml --- .gitea/workflows/build.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index fb98e4c7..37a81b41 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -9,6 +9,9 @@ jobs: steps: - uses: actions/checkout@v3 + run: | + echo "/usr/bin" >> $GITHUB_PATH + which jq # - uses: actions/setup-java@v3 # with: @@ -19,7 +22,7 @@ jobs: with: flutter-version: '3.*' channel: 'any' - run: "flutter --version" + run: "flutter --version" - name: Get dependencies run: flutter pub Get From 51aa38cefb4748d225bef67fb5c79b82f5e86980 Mon Sep 17 00:00:00 2001 From: apoloz Date: Tue, 27 Feb 2024 09:44:47 +0000 Subject: [PATCH 07/31] Update .gitea/workflows/build.yml --- .gitea/workflows/build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 37a81b41..256f7fba 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -9,6 +9,8 @@ jobs: steps: - uses: actions/checkout@v3 + + - name: check jq run: | echo "/usr/bin" >> $GITHUB_PATH which jq From 6b3c600b0e77e023648ba80bbacda7449c76b5f6 Mon Sep 17 00:00:00 2001 From: apoloz Date: Tue, 27 Feb 2024 09:46:02 +0000 Subject: [PATCH 08/31] Update .gitea/workflows/build.yml --- .gitea/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 256f7fba..42b6db61 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -24,7 +24,7 @@ jobs: with: flutter-version: '3.*' channel: 'any' - run: "flutter --version" + - run: "flutter --version" - name: Get dependencies run: flutter pub Get From 8da587992acad3c9e9fd0956e77464472da439c8 Mon Sep 17 00:00:00 2001 From: apoloz Date: Tue, 27 Feb 2024 09:47:03 +0000 Subject: [PATCH 09/31] Update .gitea/workflows/build.yml --- .gitea/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 42b6db61..f3d9dcf6 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -12,8 +12,8 @@ jobs: - name: check jq run: | - echo "/usr/bin" >> $GITHUB_PATH which jq + echo "/usr/bin" >> $GITHUB_PATH # - uses: actions/setup-java@v3 # with: From 96f20975dbdcc4e09ad0656feeefe121671089b9 Mon Sep 17 00:00:00 2001 From: apoloz Date: Tue, 27 Feb 2024 09:50:06 +0000 Subject: [PATCH 10/31] Update .gitea/workflows/build.yml --- .gitea/workflows/build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index f3d9dcf6..9e3f43e8 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -12,6 +12,8 @@ jobs: - name: check jq run: | + echo "What?" + echo $GITHUB_PATH which jq echo "/usr/bin" >> $GITHUB_PATH From f94033056d9f8176e298d67dad754e38c4a8007b Mon Sep 17 00:00:00 2001 From: apoloz Date: Tue, 27 Feb 2024 09:54:02 +0000 Subject: [PATCH 11/31] Update .gitea/workflows/build.yml --- .gitea/workflows/build.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 9e3f43e8..6664790e 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -10,10 +10,14 @@ jobs: - uses: actions/checkout@v3 + - name: Install jq + run: sudo apt-get install -y jq + - name: check jq run: | echo "What?" echo $GITHUB_PATH + sudo apt install jq which jq echo "/usr/bin" >> $GITHUB_PATH From a37336e02c33608b9abf1beae5541cc02cc3276b Mon Sep 17 00:00:00 2001 From: apoloz Date: Tue, 27 Feb 2024 09:54:38 +0000 Subject: [PATCH 12/31] Update .gitea/workflows/build.yml --- .gitea/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 6664790e..cb795887 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -11,7 +11,7 @@ jobs: - uses: actions/checkout@v3 - name: Install jq - run: sudo apt-get install -y jq + run: apt-get install -y jq - name: check jq run: | From aa2fe653833a429da0045e7ba1df1567f7fe639f Mon Sep 17 00:00:00 2001 From: apoloz Date: Tue, 27 Feb 2024 09:56:37 +0000 Subject: [PATCH 13/31] Update .gitea/workflows/build.yml --- .gitea/workflows/build.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index cb795887..7af1e8e0 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -11,7 +11,9 @@ jobs: - uses: actions/checkout@v3 - name: Install jq - run: apt-get install -y jq + run: | + apt update + apt-get install -y jq - name: check jq run: | From fbac2582e3688ad573bc0927d61b456ad27f46b9 Mon Sep 17 00:00:00 2001 From: apoloz Date: Tue, 27 Feb 2024 09:57:36 +0000 Subject: [PATCH 14/31] Update .gitea/workflows/build.yml --- .gitea/workflows/build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 7af1e8e0..fc5b11ac 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -19,7 +19,6 @@ jobs: run: | echo "What?" echo $GITHUB_PATH - sudo apt install jq which jq echo "/usr/bin" >> $GITHUB_PATH From 7d8af3b84225da47f1a0b59c08ebebb205dc1847 Mon Sep 17 00:00:00 2001 From: apoloz Date: Tue, 27 Feb 2024 09:58:56 +0000 Subject: [PATCH 15/31] Update .gitea/workflows/build.yml --- .gitea/workflows/build.yml | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index fc5b11ac..9323cfc7 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -15,13 +15,6 @@ jobs: apt update apt-get install -y jq - - name: check jq - run: | - echo "What?" - echo $GITHUB_PATH - which jq - echo "/usr/bin" >> $GITHUB_PATH - # - uses: actions/setup-java@v3 # with: # distribution: "zulu" @@ -29,8 +22,8 @@ jobs: - uses: actions/flutter-action@v2 with: - flutter-version: '3.*' - channel: 'any' + flutter-version: '3.16.4' + channel: 'stable' - run: "flutter --version" - name: Get dependencies From 9e0b85fffdfb15c4df304e8fd95795d1b379708d Mon Sep 17 00:00:00 2001 From: apoloz Date: Tue, 27 Feb 2024 10:02:39 +0000 Subject: [PATCH 16/31] Update .gitea/workflows/build.yml --- .gitea/workflows/build.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 9323cfc7..897466d6 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -27,11 +27,14 @@ jobs: - run: "flutter --version" - name: Get dependencies - run: flutter pub Get + run: flutter pub get - name: Run Code Metrics run: flutter pub run dart_code_metrics:metrics --reporter=github lib + - name: Build apk + run: flutter build apk + # Runs a set of commands using the runners shell - name: Start release build run: flutter build appbundle From e1796dc4d795c0704b0178d2dc9ea850e7645472 Mon Sep 17 00:00:00 2001 From: apoloz Date: Tue, 27 Feb 2024 10:05:41 +0000 Subject: [PATCH 17/31] Update .gitea/workflows/build.yml --- .gitea/workflows/build.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 897466d6..3d89eb5d 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -15,16 +15,15 @@ jobs: apt update apt-get install -y jq -# - uses: actions/setup-java@v3 -# with: -# distribution: "zulu" -# java-version: "12.x" + - uses: actions/setup-java@v3 + with: + distribution: "zulu" + java-version: "12.x" - uses: actions/flutter-action@v2 with: flutter-version: '3.16.4' channel: 'stable' - - run: "flutter --version" - name: Get dependencies run: flutter pub get From ecdb10a4390d3ce91a144ae7044241240c84989c Mon Sep 17 00:00:00 2001 From: apoloz Date: Tue, 27 Feb 2024 10:26:14 +0000 Subject: [PATCH 18/31] Update .gitea/workflows/build.yml --- .gitea/workflows/build.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 3d89eb5d..404a0754 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -22,9 +22,13 @@ jobs: - uses: actions/flutter-action@v2 with: - flutter-version: '3.16.4' channel: 'stable' + - run: | + flutter --version + flutter channel stable + flutter upgrade --force + - name: Get dependencies run: flutter pub get From b305e7cdccf41198fb2d99aa380ab3f2bfd68444 Mon Sep 17 00:00:00 2001 From: apoloz Date: Tue, 27 Feb 2024 10:26:35 +0000 Subject: [PATCH 19/31] Update .gitea/workflows/build.yml --- .gitea/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 404a0754..eabaa55f 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -25,9 +25,9 @@ jobs: channel: 'stable' - run: | - flutter --version - flutter channel stable - flutter upgrade --force + flutter --version + flutter channel stable + flutter upgrade --force - name: Get dependencies run: flutter pub get From 8adb3e5e3807701196794d6e32e80bf110212ec3 Mon Sep 17 00:00:00 2001 From: apoloz Date: Tue, 27 Feb 2024 10:32:29 +0000 Subject: [PATCH 20/31] Update .gitea/workflows/build.yml --- .gitea/workflows/build.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index eabaa55f..935db893 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -19,10 +19,16 @@ jobs: with: distribution: "zulu" java-version: "12.x" + cache: 'gradle' - uses: actions/flutter-action@v2 with: channel: 'stable' + cache: true + cache-key: 'flutter-:os:-:channel:-:version:-:arch:-:hash:' # optional, change this to force refresh cache + cache-path: '${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:' # optional, change this to specify the cache path + pub-cache-key: 'flutter-pub:os:-:channel:-:version:-:arch:-:hash:' # optional, change this to force refresh cache of dart pub get dependencies + pub-cache-path: '${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:' # optional, change this to specify the cache path - run: | flutter --version From 847883580e9e796079b10b43a8e2bef284d86c09 Mon Sep 17 00:00:00 2001 From: apoloz Date: Tue, 27 Feb 2024 10:48:54 +0000 Subject: [PATCH 21/31] Update .gitea/workflows/build.yml --- .gitea/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 935db893..e6aaa79b 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -24,6 +24,7 @@ jobs: - uses: actions/flutter-action@v2 with: channel: 'stable' + flutter-version: '3.19.0' cache: true cache-key: 'flutter-:os:-:channel:-:version:-:arch:-:hash:' # optional, change this to force refresh cache cache-path: '${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:' # optional, change this to specify the cache path From 464f55d8675905f95bf79bea3d1a347b4f164146 Mon Sep 17 00:00:00 2001 From: apoloz Date: Tue, 27 Feb 2024 10:51:13 +0000 Subject: [PATCH 22/31] Update .gitea/workflows/build.yml --- .gitea/workflows/build.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index e6aaa79b..919d6387 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -33,8 +33,6 @@ jobs: - run: | flutter --version - flutter channel stable - flutter upgrade --force - name: Get dependencies run: flutter pub get From 43e3d4f2a4198c8cc003884c7bbb2c9fa6c89b22 Mon Sep 17 00:00:00 2001 From: apoloz Date: Tue, 27 Feb 2024 10:55:28 +0000 Subject: [PATCH 23/31] Update .gitea/workflows/build.yml --- .gitea/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 919d6387..2265dd2a 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -33,6 +33,7 @@ jobs: - run: | flutter --version + git config --global --add safe.directory /opt/hostedtoolcache/flutter/stable-3.19.0-x64 - name: Get dependencies run: flutter pub get From 00c380d23fd2b22927b388e0849c90b327ed151c Mon Sep 17 00:00:00 2001 From: apoloz Date: Tue, 27 Feb 2024 11:06:16 +0000 Subject: [PATCH 24/31] ci(build): temporary remove build steps --- .gitea/workflows/build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 2265dd2a..67a64741 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -41,9 +41,9 @@ jobs: - name: Run Code Metrics run: flutter pub run dart_code_metrics:metrics --reporter=github lib - - name: Build apk - run: flutter build apk +# - name: Build apk +# run: flutter build apk # Runs a set of commands using the runners shell - - name: Start release build - run: flutter build appbundle +# - name: Start release build +# run: flutter build appbundle From d990c9e1e89bebed2d65ca4314103b488cac9f33 Mon Sep 17 00:00:00 2001 From: apoloz Date: Tue, 27 Feb 2024 11:12:45 +0000 Subject: [PATCH 25/31] Update .gitea/workflows/build.yml --- .gitea/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 67a64741..33e489f8 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -39,7 +39,7 @@ jobs: run: flutter pub get - name: Run Code Metrics - run: flutter pub run dart_code_metrics:metrics --reporter=github lib + run: flutter pub run dart_code_metrics:metrics lib # - name: Build apk # run: flutter build apk From 0193d046a882030d83645319ddea052cb3d4e0aa Mon Sep 17 00:00:00 2001 From: Anatoliy Poloz Date: Tue, 27 Feb 2024 14:58:26 +0300 Subject: [PATCH 26/31] ci(code-analisys) --- analysis_options.yaml | 38 +++++++++++++++++++++----------------- pubspec.yaml | 1 + 2 files changed, 22 insertions(+), 17 deletions(-) diff --git a/analysis_options.yaml b/analysis_options.yaml index 72788038..6c5f0587 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -3,20 +3,24 @@ analyzer: - 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 + extends: + - package:dart_code_metrics_presets/all.yaml +# extends: +# - recommended +# 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 diff --git a/pubspec.yaml b/pubspec.yaml index bc447661..40b6b2f2 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -26,6 +26,7 @@ dependencies: dev_dependencies: dart_code_metrics: ^5.7.6 + dart_code_metrics_presets: ^1.8.0 flutter_test: sdk: flutter flutter: From ee852e899f246ed5ef53a1149d5dc9bffea7e1e5 Mon Sep 17 00:00:00 2001 From: apoloz Date: Tue, 27 Feb 2024 12:34:01 +0000 Subject: [PATCH 27/31] ci(build): fix dir permissions and disable sunset warning --- .gitea/workflows/build.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 33e489f8..bf7886ff 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -31,15 +31,16 @@ jobs: pub-cache-key: 'flutter-pub:os:-:channel:-:version:-:arch:-:hash:' # optional, change this to force refresh cache of dart pub get dependencies pub-cache-path: '${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:' # optional, change this to specify the cache path - - run: | - flutter --version + - name: fix dir permissions + run: | git config --global --add safe.directory /opt/hostedtoolcache/flutter/stable-3.19.0-x64 + flutter --version - name: Get dependencies run: flutter pub get - name: Run Code Metrics - run: flutter pub run dart_code_metrics:metrics lib + run: flutter pub run dart_code_metrics:metrics lib --disable-sunset-warning # - name: Build apk # run: flutter build apk From 536a43ab173aa9b837bd944f61f6fd3128f240b4 Mon Sep 17 00:00:00 2001 From: apoloz Date: Tue, 27 Feb 2024 12:34:27 +0000 Subject: [PATCH 28/31] ci(build): fix typo --- .gitea/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index bf7886ff..262b34e9 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -32,7 +32,7 @@ jobs: pub-cache-path: '${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:' # optional, change this to specify the cache path - name: fix dir permissions - run: | + run: | git config --global --add safe.directory /opt/hostedtoolcache/flutter/stable-3.19.0-x64 flutter --version From 519c1f01bb9f113b3aa7551b2a057e7a735f45cd Mon Sep 17 00:00:00 2001 From: apoloz Date: Tue, 27 Feb 2024 12:42:44 +0000 Subject: [PATCH 29/31] doc(readme): fix md formating --- README.md | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index f6cc1597..39b2d892 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ # eatvio_app ### Системные требования -- Flutter (Channel stable, 3.16.4, on Ubuntu 22.04.3 LTS 6.2.0-39-generic, locale en_US.UTF-8) +- Flutter (Channel stable, 3.19.0, on Ubuntu 22.04.3 LTS 6.2.0-39-generic, locale en_US.UTF-8) - Android Studio (version 2023.1) - VS Code (version 1.85.0) - Android SDK (version 34.0.0) - устанавливается из Android Studio (Tools->SDK Manager->Android Command Line Tools) @@ -32,26 +32,27 @@ Для тестирования на устройствах Android в корневой папке проекта выполните команду -flutter build apk +`# flutter build apk` -после чего .apk файл скомпилируется в директории build/app/outputs/flutter-apk/app-release.apk +после чего `.apk` файл скомпилируется в директории `build/app/outputs/flutter-apk/app-release.apk` Данный файл установит приложение на устройство с актуальной версией OS ### Библиотеки и инструменты - flutter_bloc - контроль состояний - cached_network_image - кеширование картинок из веба - flutter_svg - работа с изображениями - equatable - сравнение без оператора "==" - validators - валидация - hive - локальная бд (1) - hive_flutter - локальная бд (2) - isar_flutter_libs - локальная бд (3) - path_provider - динамичкские пути до файлов - fl_chart - построение графиков - flutter_spinkit - прелоадеры - flutter_dotenv - переменные окружения + - **flutter_bloc** - контроль состояний + - **cached_network_image** - кеширование картинок из веба + - **flutter_svg** - работа с изображениями + - **equatable** - сравнение без оператора "==" + - **validators** - валидация + - **hive** - локальная бд (1) + - **hive_flutter** - локальная бд (2) + - **isar_flutter_libs** - локальная бд (3) + - **path_provider** - динамичкские пути до файлов + - **fl_chart** - построение графиков + - **flutter_spinkit** - прелоадеры + - **flutter_dotenv** - переменные окружения + ### Поддержка From ca798a05466de2cb4f78da50a08fd06c38aafa14 Mon Sep 17 00:00:00 2001 From: Anatoliy Poloz Date: Tue, 27 Feb 2024 16:02:10 +0300 Subject: [PATCH 30/31] ci(clean-code): tune flatter specific --- .gitea/workflows/build.yml | 26 ++++++++++++-------------- analysis_options.yaml | 2 +- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 262b34e9..2219ffb5 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -7,29 +7,28 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - name: Install jq run: | - apt update - apt-get install -y jq + apt update + apt-get install -y jq - uses: actions/setup-java@v3 with: distribution: "zulu" java-version: "12.x" - cache: 'gradle' + cache: "gradle" - uses: actions/flutter-action@v2 with: - channel: 'stable' - flutter-version: '3.19.0' + channel: "stable" + flutter-version: "3.19.0" cache: true - cache-key: 'flutter-:os:-:channel:-:version:-:arch:-:hash:' # optional, change this to force refresh cache - cache-path: '${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:' # optional, change this to specify the cache path - pub-cache-key: 'flutter-pub:os:-:channel:-:version:-:arch:-:hash:' # optional, change this to force refresh cache of dart pub get dependencies - pub-cache-path: '${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:' # optional, change this to specify the cache path + cache-key: "flutter-:os:-:channel:-:version:-:arch:-:hash:" # optional, change this to force refresh cache + cache-path: "${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:" # optional, change this to specify the cache path + pub-cache-key: "flutter-pub:os:-:channel:-:version:-:arch:-:hash:" # optional, change this to force refresh cache of dart pub get dependencies + pub-cache-path: "${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:" # optional, change this to specify the cache path - name: fix dir permissions run: | @@ -40,11 +39,10 @@ jobs: run: flutter pub get - name: Run Code Metrics - run: flutter pub run dart_code_metrics:metrics lib --disable-sunset-warning - + run: flutter pub run dart_code_metrics:metrics lib --disable-sunset-warning --fatal-warnings --fatal-performance # - name: Build apk # run: flutter build apk - - # Runs a set of commands using the runners shell + +# Runs a set of commands using the runners shell # - name: Start release build # run: flutter build appbundle diff --git a/analysis_options.yaml b/analysis_options.yaml index 6c5f0587..d15eebe1 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -4,7 +4,7 @@ analyzer: dart_code_metrics: extends: - - package:dart_code_metrics_presets/all.yaml + - package:dart_code_metrics_presets/flutter_all.yaml # extends: # - recommended # anti-patterns: From a9af60584d53f21fb2c995324e5b07704f2844a3 Mon Sep 17 00:00:00 2001 From: Anatoliy Poloz Date: Tue, 27 Feb 2024 16:09:14 +0300 Subject: [PATCH 31/31] ci(clean-code): tune bloc specific --- analysis_options.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/analysis_options.yaml b/analysis_options.yaml index d15eebe1..9722fb45 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -5,6 +5,14 @@ analyzer: dart_code_metrics: extends: - package:dart_code_metrics_presets/flutter_all.yaml + - package:dart_code_metrics_presets/bloc.yaml + metrics: + cyclomatic-complexity: 20 + lines-of-executable-code: 50 + number-of-parameters: 4 + maximum-nesting-level: 5 + metrics-exclude: + - test/** # extends: # - recommended # anti-patterns: