Skip to content

Commit

Permalink
Upgrade all packages to leancode_lint v7 (#213)
Browse files Browse the repository at this point in the history
  • Loading branch information
shilangyu authored Nov 17, 2023
1 parent 6845a23 commit 2dfa122
Show file tree
Hide file tree
Showing 27 changed files with 402 additions and 37 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/cqrs-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ jobs:
run: dart pub get

- name: Run analyzer
run: dart analyze
run: |
dart analyze
dart run custom_lint
- name: Run tests with coverage
run: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ jobs:
run: flutter pub get

- name: Run analyzer
run: flutter analyze
run: |
flutter analyze
dart run custom_lint
- name: Dry run pub publish
# We don't want it to fail the CI, it's just to see how would `pub publish` behave.
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/leancode_hooks-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ jobs:
run: flutter pub get

- name: Run analyzer
run: flutter analyze
run: |
flutter analyze
dart run custom_lint
- name: Run tests with coverage
run: flutter test --coverage
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/login_client-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ jobs:
run: dart pub get

- name: Run analyzer
run: dart analyze
run: |
dart analyze
dart run custom_lint
- name: Run tests with coverage
run: |
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/login_client_flutter-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ jobs:
run: flutter pub get

- name: Run analyzer
run: flutter analyze
run: |
flutter analyze
dart run custom_lint
- name: Dry run pub publish
# We don't want it to fail the CI, it's just to see how would `pub publish` behave.
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/override_api_endpoint-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ jobs:
run: flutter pub get

- name: Run analyzer
run: flutter analyze
run: |
flutter analyze
dart run custom_lint
- name: Dry run pub publish
# We don't want it to fail the CI, it's just to see how would `pub publish` behave.
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Miscellaneous
**.DS_Store

# Melos-generated pubspec overrides
# Melos
pubspec_overrides.yaml
/.dart_tool

# IntelliJ
*.iml
Expand Down
2 changes: 2 additions & 0 deletions packages/cqrs/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
include: package:leancode_lint/analysis_options_package.yaml

analyzer:
plugins:
- custom_lint
exclude:
- test/.test_coverage.dart
- test/*.mocks.dart
36 changes: 18 additions & 18 deletions packages/cqrs/lib/src/cqrs.dart
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,8 @@ class Cqrs {
final result = query.resultFactory(json);
_log(query, _ResultType.success);
return QuerySuccess(result);
} catch (e, s) {
_log(query, _ResultType.jsonError, e, s);
} catch (err, st) {
_log(query, _ResultType.jsonError, err, st);
return QueryFailure<T>(QueryError.unknown);
}
}
Expand All @@ -193,11 +193,11 @@ class Cqrs {
_log(query, _ResultType.authorizationError);
return QueryFailure<T>(QueryError.authorization);
}
} on SocketException catch (e, s) {
_log(query, _ResultType.networkError, e, s);
} on SocketException catch (err, st) {
_log(query, _ResultType.networkError, err, st);
return QueryFailure<T>(QueryError.network);
} catch (e, s) {
_log(query, _ResultType.unknownError, e, s);
} catch (err, st) {
_log(query, _ResultType.unknownError, err, st);
return QueryFailure<T>(QueryError.unknown);
}

Expand Down Expand Up @@ -231,8 +231,8 @@ class Cqrs {
CommandError.validation,
validationErrors: result.errors,
);
} catch (e, s) {
_log(command, _ResultType.jsonError, e, s);
} catch (err, st) {
_log(command, _ResultType.jsonError, err, st);
return const CommandFailure(CommandError.unknown);
}
}
Expand All @@ -244,11 +244,11 @@ class Cqrs {
_log(command, _ResultType.authorizationError);
return const CommandFailure(CommandError.authorization);
}
} on SocketException catch (e, s) {
_log(command, _ResultType.networkError, e, s);
} on SocketException catch (err, st) {
_log(command, _ResultType.networkError, err, st);
return const CommandFailure(CommandError.network);
} catch (e, s) {
_log(command, _ResultType.unknownError, e, s);
} catch (err, st) {
_log(command, _ResultType.unknownError, err, st);
return const CommandFailure(CommandError.unknown);
}

Expand All @@ -270,8 +270,8 @@ class Cqrs {
final result = operation.resultFactory(json);
_log(operation, _ResultType.success);
return OperationSuccess<T>(result);
} catch (e, s) {
_log(operation, _ResultType.jsonError, e, s);
} catch (err, st) {
_log(operation, _ResultType.jsonError, err, st);
return OperationFailure<T>(OperationError.unknown);
}
}
Expand All @@ -284,11 +284,11 @@ class Cqrs {
_log(operation, _ResultType.authorizationError);
return OperationFailure<T>(OperationError.authorization);
}
} on SocketException catch (e, s) {
_log(operation, _ResultType.networkError, e, s);
} on SocketException catch (err, st) {
_log(operation, _ResultType.networkError, err, st);
return OperationFailure<T>(OperationError.network);
} catch (e, s) {
_log(operation, _ResultType.unknownError, e, s);
} catch (err, st) {
_log(operation, _ResultType.unknownError, err, st);
return OperationFailure<T>(OperationError.unknown);
}

Expand Down
3 changes: 2 additions & 1 deletion packages/cqrs/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ dependencies:

dev_dependencies:
coverage: ^1.5.0
leancode_lint: ^6.0.0
custom_lint: ^0.5.6
leancode_lint: ^7.0.0
mocktail: ^1.0.1
test: ^1.17.5
4 changes: 4 additions & 0 deletions packages/debug_page/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
include: package:leancode_lint/analysis_options.yaml

analyzer:
plugins:
- custom_lint
5 changes: 3 additions & 2 deletions packages/debug_page/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ homepage: https://github.com/leancodepl/flutter_corelibrary/tree/master/packages
repository: https://github.com/leancodepl/flutter_corelibrary
description: >-
A package providing a debug page which shows outgoing http requests and Logger logs
environment:
sdk: '>=3.0.0 <4.0.0'
flutter: ">=3.10.0"
Expand All @@ -20,9 +20,10 @@ dependencies:
share_plus: ^7.0.2

dev_dependencies:
custom_lint: ^0.5.6
flutter_test:
sdk: flutter
leancode_lint: ^6.0.0
leancode_lint: ^7.0.0
mocktail: ^1.0.1

# For information on the generic Dart part of this file, see the
Expand Down
4 changes: 4 additions & 0 deletions packages/leancode_analytics/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
include: package:leancode_lint/analysis_options_package.yaml

analyzer:
plugins:
- custom_lint
4 changes: 2 additions & 2 deletions packages/leancode_analytics/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ dependencies:
sdk: flutter

dev_dependencies:
custom_lint: ^0.5.6
flutter_test:
sdk: flutter
leancode_lint: ^6.0.0
leancode_lint: ^7.0.0

flutter:

Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
include: package:leancode_lint/analysis_options_package.yaml

analyzer:
plugins:
- custom_lint
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ packages:
path: ".."
relative: true
source: path
version: "1.0.0"
version: "1.1.1"
lints:
dependency: transitive
description:
Expand Down
3 changes: 2 additions & 1 deletion packages/leancode_flutter_svg_adaptive_loader/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ dependencies:
vector_graphics_compiler: ^1.1.7

dev_dependencies:
custom_lint: ^0.5.6
flutter_test:
sdk: flutter
leancode_lint: ^6.0.0
leancode_lint: ^7.0.0
meta: ^1.9.1
4 changes: 4 additions & 0 deletions packages/leancode_hooks/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
include: package:leancode_lint/analysis_options_package.yaml

analyzer:
plugins:
- custom_lint
3 changes: 2 additions & 1 deletion packages/leancode_hooks/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ dependencies:

dev_dependencies:
coverage: ^1.2.0
custom_lint: ^0.5.6
flutter_test:
sdk: flutter
leancode_lint: ^6.0.0
leancode_lint: ^7.0.0
2 changes: 1 addition & 1 deletion packages/leancode_lint/test/lints_test_app/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ packages:
path: "../.."
relative: true
source: path
version: "7.0.0"
version: "7.0.0+1"
logging:
dependency: transitive
description:
Expand Down
2 changes: 2 additions & 0 deletions packages/login_client/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
include: package:leancode_lint/analysis_options_package.yaml

analyzer:
plugins:
- custom_lint
exclude:
- test/.test_coverage.dart
3 changes: 2 additions & 1 deletion packages/login_client/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ dependencies:

dev_dependencies:
coverage: ^1.6.3
leancode_lint: ^6.0.0
custom_lint: ^0.5.6
leancode_lint: ^7.0.0
mocktail: ^1.0.1
test: ^1.16.4
4 changes: 4 additions & 0 deletions packages/login_client_flutter/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
include: package:leancode_lint/analysis_options_package.yaml

analyzer:
plugins:
- custom_lint
3 changes: 2 additions & 1 deletion packages/login_client_flutter/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ dependencies:
login_client: ^2.0.1

dev_dependencies:
leancode_lint: ^6.0.0
custom_lint: ^0.5.6
leancode_lint: ^7.0.0
4 changes: 4 additions & 0 deletions packages/override_api_endpoint/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
include: package:leancode_lint/analysis_options_package.yaml

analyzer:
plugins:
- custom_lint
3 changes: 2 additions & 1 deletion packages/override_api_endpoint/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ dependencies:
shared_preferences: ^2.0.6

dev_dependencies:
leancode_lint: ^6.0.0
custom_lint: ^0.5.6
leancode_lint: ^7.0.0
Loading

0 comments on commit 2dfa122

Please sign in to comment.