Skip to content

Commit

Permalink
ci: enable rules correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
falko17 committed Dec 8, 2021
1 parent a185d65 commit 54699be
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 53 deletions.
114 changes: 62 additions & 52 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,9 @@
# This set helps identify many issues that may lead to problems when running
# or consuming Dart code, and enforces writing Dart using a single, idiomatic
# style and format.
#
# If you want a smaller set of lints you can change this to specify
# 'package:lints/core.yaml'. These are just the most critical lints
# (the recommended set includes the core lints).
# The core lints are also what is used by pub.dev for scoring packages.

include: package:lints/recommended.yaml

# Uncomment the following section to specify additional rules.

# linter:
# rules:
# - camel_case_types

# analyzer:
# exclude:
# - path/to/excluded/files/**

# For more information about the core and recommended set of lints, see
# https://dart.dev/go/core-lints

Expand All @@ -33,46 +18,71 @@ analyzer:
strong-mode:
implicit-casts: false
implicit-dynamic: false
errors:
missing_required_param: warning
missing_return: warning
package_api_docs: warning
#TODO: Change to warning
public_member_api_docs: info
prefer_interpolation_to_compose_strings: warning
unnecessary_lambdas: warning
avoid_catches_without_on_clauses: warning
avoid_catching_errors: warning
prefer_mixin: warning
use_setters_to_change_properties: warning
avoid_setters_without_getters: warning
type_annotate_public_apis: warning
always_declare_return_types: warning
avoid_void_async: warning
flutter_style_todos: warning
only_throw_errors: warning
prefer_final_locals: warning
prefer_null_aware_method_calls: warning
unawaited_futures: warning
depend_on_referenced_packages: warning
flutter_style_todos: info
deprecated_member_use_from_same_package: info
todo: ignore

# Rules in addition to recommended set
linter:
- directives_ordering
- package_api_docs
- public_member_api_docs
- comment_references
- prefer_interpolation_to_compose_strings
- unnecesary_lambdas
- lines_longer_than_80_chars
- avoid_catches_without_on_clauses # no pokémon exception handling (at least only catch Exception)
- avoid_catching_errors
- use_to_and_as_if_applicable # this rule may cause false positives, if so, just disable it
- prefer_mixin
- use_setters_to_change_properties
- avoid_setters_without_getters # use a method instead
- avoid_returning_this # use cascades instead
- type_annotate_public_apis
- avoid_types_on_closure_parameters
- avoid_positional_boolean_parameters
- avoid_dynamic_calls
- avoid_returning_null_for_future
- avoid_slow_async_io
- cancel_subscriptions
- close_sinks
- always_declare_return_types
- avoid_void_async
- cascade_invocations
- eol_at_end_of_file
- flutter_style_todos
- leading_newlines_in_multiline_strings
- only_throw_errors
- prefer_final_locals
- prefer_final_parameters
- prefer_null_aware_method_calls
- unawaited_futures
- unnecessary_null_aware_assignments
- use_if_null_to_convert_nulls_to_bools
- use_is_even_rather_than_modulo
- depend_on_referenced_packages
rules:
- directives_ordering
- package_api_docs
- public_member_api_docs
- comment_references
- prefer_interpolation_to_compose_strings
- unnecessary_lambdas
- lines_longer_than_80_chars
- avoid_catches_without_on_clauses # no pokémon exception handling (at least only catch Exception)
- avoid_catching_errors
- use_to_and_as_if_applicable # this rule may cause false positives, if so, just disable it
- prefer_mixin
- use_setters_to_change_properties
- avoid_setters_without_getters # use a method instead
- avoid_returning_this # use cascades instead
- type_annotate_public_apis
- avoid_types_on_closure_parameters
- avoid_positional_boolean_parameters
- avoid_dynamic_calls
- avoid_returning_null_for_future
- avoid_slow_async_io
- cancel_subscriptions
- close_sinks
- always_declare_return_types
- avoid_void_async
- cascade_invocations
- eol_at_end_of_file
- flutter_style_todos
- leading_newlines_in_multiline_strings
- only_throw_errors
- prefer_final_locals
- prefer_null_aware_method_calls
- unawaited_futures
- unnecessary_null_aware_assignments
- use_if_null_to_convert_nulls_to_bools
- use_is_even_rather_than_modulo
- depend_on_referenced_packages


dart_code_metrics:
Expand Down
2 changes: 1 addition & 1 deletion example/dart_wot_example.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:dart_wot/dart_wot.dart';

void main() {
var awesome = Awesome();
final awesome = Awesome();
print('awesome: ${awesome.isAwesome}');
}

0 comments on commit 54699be

Please sign in to comment.