Skip to content

Commit

Permalink
Enable and fix some lints
Browse files Browse the repository at this point in the history
Ignore other lints in generated code
  • Loading branch information
kevmoo committed Feb 25, 2020
1 parent 3edc86a commit 9877105
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 6 deletions.
11 changes: 7 additions & 4 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
include: package:pedantic/analysis_options.yaml

analyzer:
strong-mode:
implicit-casts: false

linter:
rules:
- always_declare_return_types
Expand Down Expand Up @@ -45,10 +47,10 @@ linter:
- join_return_with_assignment
- library_names
- library_prefixes
# Need to ignore in build_cli
#- lines_longer_than_80_chars
- lines_longer_than_80_chars
- list_remove_unrelated_type
- literal_only_boolean_expressions
- missing_whitespace_between_adjacent_strings
- no_adjacent_strings_in_list
- no_duplicate_case_values
- no_runtimeType_toString
Expand All @@ -68,8 +70,7 @@ linter:
- prefer_const_declarations
- prefer_contains
- prefer_equal_for_default_values
# Need to ignore in build_cli!
#- prefer_expression_function_bodies
- prefer_expression_function_bodies
- prefer_final_fields
- prefer_final_locals
- prefer_function_declarations_over_variables
Expand All @@ -85,6 +86,7 @@ linter:
- prefer_single_quotes
- prefer_typing_uninitialized_variables
- prefer_void_to_null
- provide_deprecation_message
- recursive_getters
- slash_for_doc_comments
- sort_pub_dependencies
Expand All @@ -107,5 +109,6 @@ linter:
- unrelated_type_equality_checks
- use_function_type_syntax_for_parameters
- use_rethrow_when_possible
- use_string_buffers
- valid_regexps
- void_checks
7 changes: 7 additions & 0 deletions build.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
targets:
$default:
builders:
# The end-user of a builder which applies "source_gen|combining_builder"
# may configure the builder to ignore specific lints for their project
source_gen|combining_builder:
options:
ignore_for_file:
- lines_longer_than_80_chars
- prefer_expression_function_bodies
build_web_compilers|entrypoint:
# These are globs for the entrypoints you want to compile.
generate_for:
Expand Down
2 changes: 2 additions & 0 deletions lib/src/options.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions lib/src/peanut.dart
Original file line number Diff line number Diff line change
Expand Up @@ -277,5 +277,5 @@ String _prettyName(String input) => input
.join(' ');

String _linkForEntry(MapEntry<String, String> entry) =>
' <p><a href="${entry.key}/" target="example_frame">'
'${_prettyName(entry.value)}</a></p>';
' <p><a href="${entry.key}/" '
'target="example_frame">${_prettyName(entry.value)}</a></p>';
2 changes: 2 additions & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ dev_dependencies:

json_serializable: ^3.2.0
pedantic: ^1.3.0
# Needed because we are configuring `combining_builder`
source_gen: ^0.9.5
test: ^1.6.0
test_descriptor: ^1.1.1
test_process: ^1.0.1
Expand Down

0 comments on commit 9877105

Please sign in to comment.