Skip to content

Commit

Permalink
Use supernova for lint configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasWanke committed Aug 22, 2023
1 parent ea3470b commit 7fe60e4
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 161 deletions.
127 changes: 1 addition & 126 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,126 +1 @@
include: package:flutter_lints/flutter.yaml

analyzer:
language:
strict-casts: true
strict-inference: true
strict-raw-types: true
plugins:
- dart_code_metrics

linter:
rules:
always_declare_return_types: true
avoid_bool_literals_in_conditional_expressions: true
avoid_catching_errors: true
avoid_double_and_int_checks: true
avoid_field_initializers_in_const_classes: true
avoid_final_parameters: true
avoid_implementing_value_types: true
avoid_js_rounded_ints: true
avoid_multiple_declarations_per_line: true
avoid_positional_boolean_parameters: true
avoid_returning_this: true
avoid_setters_without_getters: true
avoid_slow_async_io: true
avoid_types_on_closure_parameters: true
avoid_unused_constructor_parameters: true
avoid_void_async: true
cancel_subscriptions: true
cast_nullable_to_non_nullable: true
close_sinks: true
collection_methods_unrelated_type: true
combinators_ordering: true
comment_references: true
conditional_uri_does_not_exist: true
dangling_library_doc_comments: true
directives_ordering: true
discarded_futures: true
enable_null_safety: true
flutter_style_todos: true
implicit_call_tearoffs: true
join_return_with_assignment: true
library_annotations: true
no_adjacent_strings_in_list: true
omit_local_variable_types: true
only_throw_errors: true
prefer_asserts_in_initializer_lists: true
prefer_final_in_for_each: true
prefer_final_locals: true
prefer_foreach: true
prefer_if_elements_to_conditional_expressions: true
prefer_int_literals: true
prefer_relative_imports: true
prefer_single_quotes: true
secure_pubspec_urls: true
sized_box_shrink_expand: true
sort_constructors_first: true
sort_pub_dependencies: true
sort_unnamed_constructors_first: true
test_types_in_equals: true
throw_in_finally: true
tighten_type_of_initializing_formals: true
unawaited_futures: true
unnecessary_await_in_return: false
unnecessary_lambdas: true
unnecessary_library_directive: true
unnecessary_null_aware_operator_on_extension_on_nullable: true
unnecessary_parenthesis: true
unnecessary_statements: true
unnecessary_to_list_in_spreads: true
unreachable_from_main: true
unsafe_html: true
use_colored_box: true
use_decorated_box: true
use_enums: true
use_key_in_widget_constructors: false
use_setters_to_change_properties: true
use_string_buffers: true
use_string_in_part_of_directives: true
use_super_parameters: true

dart_code_metrics:
rules:
- always-remove-listener
- avoid-border-all
- avoid-cascade-after-if-null
- avoid-collection-methods-with-unrelated-types
- avoid-duplicate-exports
- avoid-global-state
- avoid-missing-enum-constant-in-map
- avoid-nested-conditional-expressions:
acceptable-level: 3
- avoid-shrink-wrap-in-lists
- avoid-top-level-members-in-tests
- avoid-unnecessary-setstate
- avoid-unnecessary-type-assertions
- avoid-unnecessary-type-casts
- avoid-unrelated-type-assertions
- avoid-unused-parameters
- avoid-wrapping-in-padding
- binary-expression-operand-order
- check-for-equals-in-render-object-setters
- consistent-update-render-object
- double-literal-format
- missing-test-assertion
- no-boolean-literal-compare
- no-equal-then-else
- no-object-declaration
- prefer-async-await
- prefer-const-border-radius # ?
- prefer-correct-edge-insets-constructor
- prefer-correct-test-file-name
- prefer-enums-by-name
- prefer-extracting-callbacks:
allowed-line-count: 5
ignored-named-arguments:
- builder
- rowBuilder
- prefer-first
- prefer-immediate-return
- prefer-intl-name
- prefer-iterable-of
- prefer-last
- prefer-trailing-comma
- provide-correct-intl-args
- tag-name
include: package:supernova/lints.yaml
66 changes: 33 additions & 33 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ packages:
dependency: transitive
description:
name: collection
sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c"
sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687
url: "https://pub.dev"
source: hosted
version: "1.17.1"
version: "1.17.2"
data_size:
dependency: transitive
description:
Expand All @@ -60,10 +60,10 @@ packages:
dependency: transitive
description:
name: device_info_plus
sha256: "9b1a0c32b2a503f8fe9f8764fac7b5fcd4f6bd35d8f49de5350bccf9e2a33b8a"
sha256: "86add5ef97215562d2e090535b0a16f197902b10c369c558a100e74ea06e8659"
url: "https://pub.dev"
source: hosted
version: "9.0.0"
version: "9.0.3"
device_info_plus_platform_interface:
dependency: transitive
description:
Expand All @@ -76,18 +76,18 @@ packages:
dependency: transitive
description:
name: ffi
sha256: ed5337a5660c506388a9f012be0288fb38b49020ce2b45fe1f8b8323fe429f99
sha256: "7bf0adc28a23d395f19f3f1eb21dd7cfd1dd9f8e1c50051c069122e6853bc878"
url: "https://pub.dev"
source: hosted
version: "2.0.2"
version: "2.1.0"
file:
dependency: transitive
description:
name: file
sha256: "1b92bec4fc2a72f59a8e15af5f52cd441e4a7860b49499d69dfa817af20e925d"
sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c"
url: "https://pub.dev"
source: hosted
version: "6.1.4"
version: "7.0.0"
flutter:
dependency: "direct main"
description: flutter
Expand Down Expand Up @@ -115,10 +115,10 @@ packages:
dependency: transitive
description:
name: http
sha256: "5895291c13fa8a3bd82e76d5627f69e0d85ca6a30dcac95c4ea19a5d555879c2"
sha256: "759d1a329847dd0f39226c688d3e06a6b8679668e350e2891a6474f8b4bb8525"
url: "https://pub.dev"
source: hosted
version: "0.13.6"
version: "1.1.0"
http_parser:
dependency: transitive
description:
Expand All @@ -139,26 +139,18 @@ packages:
dependency: transitive
description:
name: intl
sha256: a3715e3bc90294e971cb7dc063fbf3cd9ee0ebf8604ffeafabd9e6f16abbdbe6
sha256: "3bc132a9dbce73a7e4a21a17d06e1878839ffbf975568bc875c60537824b0c4d"
url: "https://pub.dev"
source: hosted
version: "0.18.0"
js:
dependency: transitive
description:
name: js
sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3
url: "https://pub.dev"
source: hosted
version: "0.6.7"
version: "0.18.1"
lints:
dependency: transitive
description:
name: lints
sha256: "6b0206b0bf4f04961fc5438198ccb3a885685cd67d4d4a32cc20ad7f8adbe015"
sha256: "0a217c6c989d21039f1498c3ed9f3ed71b354e69873f13a8dfc3c9fe76f1b452"
url: "https://pub.dev"
source: hosted
version: "2.1.0"
version: "2.1.1"
list_diff:
dependency: transitive
description:
Expand All @@ -171,10 +163,10 @@ packages:
dependency: transitive
description:
name: material_color_utilities
sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724
sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41"
url: "https://pub.dev"
source: hosted
version: "0.2.0"
version: "0.5.0"
meta:
dependency: transitive
description:
Expand All @@ -187,10 +179,10 @@ packages:
dependency: transitive
description:
name: package_info_plus
sha256: d39e8fbff4c5aef4592737e25ad6ac500df006ce7a7a8e1f838ce1256e167542
sha256: "6ff267fcd9d48cb61c8df74a82680e8b82e940231bb5f68356672fde0397334a"
url: "https://pub.dev"
source: hosted
version: "4.0.0"
version: "4.1.0"
package_info_plus_platform_interface:
dependency: transitive
description:
Expand All @@ -211,10 +203,10 @@ packages:
dependency: transitive
description:
name: plugin_platform_interface
sha256: "6a2128648c854906c53fa8e33986fc0247a1116122f9534dd20e3ab9e16a32bc"
sha256: "43798d895c929056255600343db8f049921cbec94d31ec87f1dc5c16c01935dd"
url: "https://pub.dev"
source: hosted
version: "2.1.4"
version: "2.1.5"
sensors_plus:
dependency: transitive
description:
Expand Down Expand Up @@ -292,22 +284,30 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.1.4"
web:
dependency: transitive
description:
name: web
sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10
url: "https://pub.dev"
source: hosted
version: "0.1.4-beta"
win32:
dependency: transitive
description:
name: win32
sha256: "5a751eddf9db89b3e5f9d50c20ab8612296e4e8db69009788d6c8b060a84191c"
sha256: f2add6fa510d3ae152903412227bda57d0d5a8da61d2c39c1fb022c9429a41c0
url: "https://pub.dev"
source: hosted
version: "4.1.4"
version: "5.0.6"
win32_registry:
dependency: transitive
description:
name: win32_registry
sha256: "1c52f994bdccb77103a6231ad4ea331a244dbcef5d1f37d8462f713143b0bfae"
sha256: e4506d60b7244251bc59df15656a3093501c37fb5af02105a944d73eb95be4c9
url: "https://pub.dev"
source: hosted
version: "1.1.0"
version: "1.1.1"
sdks:
dart: ">=3.0.0 <4.0.0"
dart: ">=3.1.0-185.0.dev <4.0.0"
flutter: ">=3.10.0"
7 changes: 5 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,8 @@ dependencies:
shake: ^2.0.0

dev_dependencies:
dart_code_metrics: ^5.0.1
flutter_lints: ^2.0.1
supernova_flutter:
git:
url: https://github.com/JonasWanke/supernova.git
path: supernova_flutter
ref: 281f167123facb724d112ffc84349cf39d8f691f

0 comments on commit 7fe60e4

Please sign in to comment.