Skip to content

Commit

Permalink
Add missing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
n-bernat committed Aug 10, 2023
1 parent dd8333c commit 48ccaab
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 404 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/flutter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,6 @@ jobs:
- name: Check formatting
run: dart format . --set-exit-if-changed

# example app shows warnings as an example of a working linter, so
# we can't analyze it as its purpose is to have issues
- name: Disable analyzer for example app
run: rm example/analysis_options.yaml

- name: Run default analyzer
run: flutter analyze

Expand Down
2 changes: 1 addition & 1 deletion example/analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ analyzer:

custom_lint:
rules:
- cyclomatic_complexity_metric:
- cyclomatic_complexity:
max_complexity: 4
- number_of_parameters:
max_parameters: 2
26 changes: 0 additions & 26 deletions example/lib/solid_lints_example.dart

This file was deleted.

15 changes: 15 additions & 0 deletions example/test/cyclomatic_complexity_test.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// ignore_for_file: literal_only_boolean_expressions

/// Check complexity fail
///
/// `cyclomatic_complexity_metric: max_complexity`
/// expect_lint: cyclomatic_complexity
void cyclomaticComplexity() {
if (true) {
if (true) {
if (true) {
if (true) {}
}
}
}
}
7 changes: 7 additions & 0 deletions example/test/number_of_parameters_test.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/// Check number of parameters fail
///
/// `number_of_parameters: max_parameters`
/// expect_lint: number_of_parameters
String numberOfParameters(String a, String b, String c) {
return a + b + c;
}
Loading

0 comments on commit 48ccaab

Please sign in to comment.