Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
3163868
add lints (wip)
malik1004x Apr 26, 2026
e2076fb
Merge branch 'dev' into add-lints
malik1004x Jun 26, 2026
ce86bb8
move to builtin custom lint api
malik1004x Jun 29, 2026
963573f
Merge branch 'dev' into add-lints
malik1004x Jun 29, 2026
6356db6
remove broken lint.sh
malik1004x Jun 29, 2026
639347b
remove use_decorated_box
malik1004x Jun 29, 2026
120699c
connect lint_check ci to lint.sh
malik1004x Jun 29, 2026
c83d53b
add typecast so app builds without disabling analyzer
malik1004x Jun 29, 2026
a6fff48
remove broken analysis_options from cw_* packages
malik1004x Jun 29, 2026
b6ea250
remove unneeded dependency override
malik1004x Jun 29, 2026
720f2d5
fix stupid naming
malik1004x Jun 29, 2026
9803d12
add configure to ci
malik1004x Jun 29, 2026
961dad1
move lint call to reusable-build.yml
malik1004x Jun 29, 2026
064362b
workaround weird analyzer bug by reordering linter rules
malik1004x Jun 29, 2026
676d24b
return to old lint.sh to not format deps in scripts
malik1004x Jun 29, 2026
4869f0b
add super.key to BasePage constructor
malik1004x Jun 29, 2026
7800700
disable use_key lint because it's bugged
malik1004x Jun 29, 2026
1e2be90
Revert "add super.key to BasePage constructor"
malik1004x Jun 29, 2026
a78b4f0
add cw_* to lint.sh
malik1004x Jun 29, 2026
c1e52ed
remove obvious type lint because it's bugged again (thanks google!)
malik1004x Jun 29, 2026
e8b5771
ABORT_ON_CHANGE
malik1004x Jun 29, 2026
266c72a
exclude tool and cw_custom_lints from printV check
malik1004x Jun 29, 2026
e597443
exclude cw_custom_lints from http import check
malik1004x Jun 29, 2026
6022ebf
test add lint as separate action
malik1004x Jun 29, 2026
30cde78
remove compile graphics from lint ci
malik1004x Jun 29, 2026
1a77817
add container info to ci
malik1004x Jun 29, 2026
cefd15c
fix
malik1004x Jun 29, 2026
73c8a55
fix
malik1004x Jun 29, 2026
337c15f
format only files after te 29th
malik1004x Jun 29, 2026
83f03c5
git-based date check
malik1004x Jun 29, 2026
004327b
remove lint from reusable-build.yml
malik1004x Jun 29, 2026
f596e4b
move lint.sh out of scripts
malik1004x Jun 29, 2026
e469bc4
./
malik1004x Jun 29, 2026
20ec6d3
test fix ci
malik1004x Jun 29, 2026
2228a9b
move lint.sh
malik1004x Jun 29, 2026
62c7ede
move lint.sh
malik1004x Jun 29, 2026
7f3d15b
print all changed files
malik1004x Jun 29, 2026
df4e843
fix ci hopefully
malik1004x Jun 29, 2026
5f610cd
revert
malik1004x Jun 29, 2026
8bf8fa2
try ci without cache
malik1004x Jun 29, 2026
800eda6
fix torch, apparently
malik1004x Jun 29, 2026
904da2b
nicer logging
malik1004x Jun 29, 2026
48110d2
add bitbox
malik1004x Jun 29, 2026
53ac8e0
remove zec
malik1004x Jun 29, 2026
54ad756
add zec prep-only
malik1004x Jun 29, 2026
a3897be
only detect changes in dart files
malik1004x Jun 29, 2026
6d702ec
add main.dart
malik1004x Jun 30, 2026
6920430
update lints
malik1004x Jul 8, 2026
48a574e
Merge branch 'dev' into add-lints
malik1004x Jul 11, 2026
990adc1
fix printV warnings being displayed when editing printV
malik1004x Jul 13, 2026
4da1799
Merge remote-tracking branch 'origin/dev' into add-lints
MrCyjaneK Jul 14, 2026
c7b1ba0
Merge remote-tracking branch 'origin/dev' into add-lints
MrCyjaneK Jul 14, 2026
698faab
Merge remote-tracking branch 'origin/add-lints' into add-lints
malik1004x Jul 14, 2026
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
109 changes: 109 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
name: Lint

on: [pull_request]

defaults:
run:
shell: bash
jobs:
lint:
runs-on: [Linux, amd64, android]
container:
image: ghcr.io/cake-tech/cake_wallet:debian13-flutter3.41.9-ndkr28-go1.24.1-ruststablenightly
env:
STORE_PASS: test@cake_wallet
KEY_PASS: test@cake_wallet
MONEROC_CACHE_DIR_ROOT: /opt/generic_cache
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
ANDROID_AVD_HOME: /root/.android/avd
volumes:
- /opt/cw_cache_android/root/.cache:/root/.cache
- /opt/cw_cache_android/root/.android/avd/:/root/.android/avd
- /opt/cw_cache_android/root/.ccache:/root/.ccache
- /opt/cw_cache_android/root/.pub-cache/:/root/.pub-cache
- /opt/cw_cache_android/root/.gradle/:/root/.gradle
- /opt/cw_cache_android/root/.android/:/root/.android
- /opt/cw_cache_android/root/go/pkg:/root/go/pkg
- /opt/cw_cache_android/opt/generic_cache:/opt/generic_cache
- /dev/kvm:/dev/kvm
- /var/run/docker.sock:/var/run/docker.sock
strategy:
matrix:
api-level: [ 29 ]

steps:
- name: configure git
run: |
git config --global --add safe.directory '*'
git config --global user.email "ci@cakewallet.com"
git config --global user.name "CakeWallet CI"
- name: Fetch prebuilt Torch
run: |
set -x -e
pushd scripts
wget https://github.com/MrCyjaneK/torch_dart/releases/download/v1.0.17/torch_dart-v1.0.17.tar.gz -O torch_dart.tar.gz
rm -rf torch_dart
mkdir torch_dart
pushd torch_dart
tar -xzf ../torch_dart.tar.gz
popd
rm ./torch_dart.tar.gz
popd
- name: Fetch prebuilt Reown
run: |
set -x -e
pushd scripts
# cleaning
rm -rf reown_flutter
rm -f reown_flutter.tar.gz
wget https://github.com/cake-tech/reown_flutter/releases/download/v0.0.4/reown_flutter-v0.0.4.tar.gz -O reown_flutter.tar.gz
mkdir reown_flutter
pushd reown_flutter
tar -xzf ../reown_flutter.tar.gz
popd
rm ./reown_flutter.tar.gz
popd
- name: Build Bitbox Flutter
run: |
set -x -e
pushd scripts
./build_bitbox_flutter.sh
popd
- name: Prepare Zcash
run: |
set -x -e
scripts/prepare_zcash.sh
- name: Execute Build and Setup Commands
run: |
pushd scripts/android
source ./app_env.sh cakewallet
export GITHUB_HUH=yeah
./app_config.sh
popd
- name: Install Flutter dependencies
run: |
flutter pub get
- name: Build generated code
run: |
flutter --version
flutter clean
rm -rf .dart_tool
rm pubspec.lock
flutter pub get
./model_generator.sh async
- name: Generate localization
run: |
dart run tool/generate_localization.dart
- name: Lint
run: |
ABORT_ON_CHANGE=yeah scripts/lint.sh
3 changes: 1 addition & 2 deletions .github/workflows/no_http_imports.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@ jobs:
- name: Check for http package usage
if: github.event_name == 'pull_request'
run: |
GIT_GREP_OUT="$(git grep package:http | (grep .dart: || test $? = 1) | (grep -v proxy_wrapper.dart || test $? = 1) | (grep -v very_insecure_http_do_not_use || test $? = 1) || true)"
GIT_GREP_OUT="$(git grep package:http | (grep .dart: || test $? = 1) | (grep -v proxy_wrapper.dart || test $? = 1) | (grep -v very_insecure_http_do_not_use || test $? = 1) | (grep -v '^cw_custom_lints/' || test $? = 1) || true)"
[[ "x$GIT_GREP_OUT" == "x" ]] && exit 0
echo "$GIT_GREP_OUT"
echo "There are .dart files which use http imports"
echo "Using http package breaks proxy integration"
echo "Please use ProxyWrapper.getHttpClient() from package:cw_core/utils/proxy_wrapper.dart"
exit 1

2 changes: 1 addition & 1 deletion .github/workflows/no_print_in_dart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- name: Check for print() statements in dart code (use printV() instead)
if: github.event_name == 'pull_request'
run: |
GIT_GREP_OUT="$(git grep ' print(' | (grep .dart: || test $? = 1) | (grep -v print_verbose.dart || test $? = 1) | (grep -v print_verbose_dummy.dart || test $? = 1) || true)"
GIT_GREP_OUT="$(git grep ' print(' | (grep .dart: || test $? = 1) | (grep -v print_verbose.dart || test $? = 1) | (grep -v print_verbose_dummy.dart || test $? = 1) | (grep -v '^tool/' || test $? = 1) | (grep -v '^cw_custom_lints/' || test $? = 1) || true)"
[[ "x$GIT_GREP_OUT" == "x" ]] && exit 0
echo "$GIT_GREP_OUT"
echo "There are .dart files which use print() statements"
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/pr_test_build_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,6 @@ jobs:
with:
path: ${{ github.workspace }}/build/linux/x64/release/cakewallet_linux.zip
name: cakewallet_linux
- name: Verify lint
run: |
exec env ABORT_ON_CHANGE=true ./scripts/lint.sh

- name: Prepare virtual desktop
if: ${{ contains(env.message, 'run tests') }}
Expand Down
167 changes: 113 additions & 54 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
include: package:lints/recommended.yaml
Comment thread
OmarHatem28 marked this conversation as resolved.


analyzer:
Expand All @@ -9,6 +8,7 @@ analyzer:
cw_core/lib/**.g.dart,
cw_haven/lib/**.g.dart,
cw_monero/lib/**.g.dart,
cw_mweb/lib/**.g.dart,
lib/generated/*.dart,
cw_monero/ios/External/**,
cw_shared_external/**,
Expand All @@ -18,65 +18,124 @@ analyzer:
strict-casts: true
strict-raw-types: true

plugins:
cw_custom_lints:
path: cw_custom_lints

linter:
rules:
- cancel_subscriptions
- always_declare_return_types
- prefer_final_fields
- always_put_control_body_on_new_line
- always_put_required_named_parameters_first
- always_use_package_imports
- annotate_overrides
- annotate_redeclares
- avoid_empty_else
- avoid_function_literals_in_foreach_calls
- avoid_init_to_null
- avoid_multiple_declarations_per_line
- avoid_positional_boolean_parameters
- avoid_relative_lib_imports
- avoid_renaming_method_parameters
- avoid_return_types_on_setters
- avoid_returning_null_for_void
- avoid_slow_async_io
- avoid_types_as_parameter_names
- avoid_types_on_closure_parameters
- avoid_unnecessary_containers
- avoid_unused_constructor_parameters
- avoid_void_async
- await_only_futures
- camel_case_extensions
- camel_case_types
- cast_nullable_to_non_nullable
- collection_methods_unrelated_type
- constant_identifier_names
- curly_braces_in_flow_control_structures
- directives_ordering
- empty_constructor_bodies
- empty_statements
- eol_at_end_of_file
- flutter_style_todos
- hash_and_equals
- implicit_reopen
- library_private_types_in_public_api
- non_constant_identifier_names
- only_throw_errors
- package_names
- prefer_asserts_with_message
- prefer_conditional_assignment
- prefer_const_constructors
- prefer_const_constructors_in_immutables
- prefer_const_declarations
- prefer_constructors_over_static_methods
- prefer_contains
- prefer_double_quotes
- prefer_expression_function_bodies
- prefer_final_in_for_each
- prefer_function_declarations_over_variables
- prefer_if_null_operators
- prefer_initializing_formals
- prefer_inlined_adds
- prefer_int_literals
- prefer_is_empty
- prefer_is_not_empty
- prefer_is_not_operator
- prefer_iterable_wheretype
- prefer_null_aware_operators
- prefer_spread_collections
- prefer_typing_uninitialized_variables
- recursive_getters
- require_trailing_commas
- sized_box_for_whitespace
- sort_child_properties_last
- sort_constructors_first
- sort_unnamed_constructors_first
- test_types_in_equals
- unawaited_futures
- unnecessary_async
- unnecessary_await_in_return
- unnecessary_const
- unnecessary_constructor_name
- unnecessary_lambdas
- unnecessary_late
- unnecessary_new
- unnecessary_null_aware_assignments
- unnecessary_null_checks
- unnecessary_null_in_if_null_operators
- unnecessary_nullable_for_final_variable_declarations
- unnecessary_overrides
- unnecessary_parenthesis
- unnecessary_string_escapes
- unnecessary_string_interpolations
- unnecessary_this
- unnecessary_to_list_in_spreads
- unnecessary_underscores
- unreachable_from_main
- unrelated_type_equality_checks
- use_build_context_synchronously
- use_colored_box
- use_full_hex_values_for_flutter_colors
- use_function_type_syntax_for_parameters
- use_is_even_rather_than_modulo
- use_named_constants
- use_null_aware_elements
- use_raw_strings
- use_rethrow_when_possible
- use_string_buffers
- use_super_parameters
- use_truncating_division
- valid_regexps
- void_checks
- prefer_final_locals
- prefer_interpolation_to_compose_strings
- null_closures
- no_wildcard_variable_uses


formatter:
page_width: 100


# analyzer:
# strong-mode:
# implicit-casts: false
# implicit-dynamic: false
# exclude: [build/**, lib/generated/*.dart, lib/**.g.dart, cw_monero/ios/External/**, cw_shared_external/**, shared_external/**]

# linter:
# rules:
# - always_declare_return_types
# - annotate_overrides
# - avoid_empty_else
# - avoid_init_to_null
# - avoid_return_types_on_setters
# - await_only_futures
# - camel_case_types
# - cancel_subscriptions
# - close_sinks
# - comment_references
# - constant_identifier_names
# - control_flow_in_finally
# - empty_catches
# - empty_constructor_bodies
# - empty_statements
# - hash_and_equals
# - invariant_booleans
# - iterable_contains_unrelated_type
# - library_names
# - library_prefixes
# - list_remove_unrelated_type
# - literal_only_boolean_expressions
# - non_constant_identifier_names
# - one_member_abstracts
# - only_throw_errors
# - overridden_fields
# - package_api_docs
# - package_names
# - package_prefixed_library_names
# - parameter_assignments
# - prefer_final_fields
# - prefer_final_locals
# - prefer_is_not_empty
# - slash_for_doc_comments
# - sort_constructors_first
# - sort_unnamed_constructors_first
# - test_types_in_equals
# - throw_in_finally
# - type_init_formals
# - unawaited_futures
# - unnecessary_getters_setters
# - unrelated_type_equality_checks
# - valid_regexps
formatter:
page_width: 100
2 changes: 1 addition & 1 deletion cw_bitcoin/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ author: Cake Wallet
homepage: https://cakewallet.com

environment:
sdk: ">=2.17.5 <3.0.0"
sdk: ">=3.0.0 <4.0.0"
flutter: ">=1.20.0"

dependencies:
Expand Down
4 changes: 0 additions & 4 deletions cw_bitcoin_cash/analysis_options.yaml

This file was deleted.

Loading
Loading