Skip to content

Commit

Permalink
Change example
Browse files Browse the repository at this point in the history
  • Loading branch information
mirland committed Nov 8, 2023
1 parent b02a2ab commit 0fc8403
Show file tree
Hide file tree
Showing 91 changed files with 37 additions and 339 deletions.
139 changes: 1 addition & 138 deletions catalog/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,138 +1 @@
# This file configures the analyzer, which statically analyzes Dart code to
# check for errors, warnings, and lints.
#
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
# invoked from the command line by running `flutter analyze`.

# The following line activates a set of recommended lints for Flutter apps,
# packages, and plugins designed to encourage good coding practices.
include: package:flutter_lints/flutter.yaml

linter:
rules:
- always_declare_return_types
- always_put_required_named_parameters_first
- always_use_package_imports
- annotate_overrides
- avoid_bool_literals_in_conditional_expressions
- avoid_catching_errors
- avoid_empty_else
- avoid_multiple_declarations_per_line
- avoid_null_checks_in_equality_operators
- avoid_print
- avoid_relative_lib_imports
- avoid_renaming_method_parameters
- avoid_return_types_on_setters
- avoid_returning_null
- avoid_returning_null_for_future
- avoid_returning_null_for_void
- avoid_returning_this
- avoid_shadowing_type_parameters
- avoid_single_cascade_in_expression_statements
- avoid_type_to_string
- avoid_types_as_parameter_names
- avoid_unnecessary_containers
- avoid_void_async
- camel_case_extensions
- camel_case_types
- cancel_subscriptions
- cascade_invocations
- cast_nullable_to_non_nullable
- close_sinks
- constant_identifier_names
- curly_braces_in_flow_control_structures
- empty_constructor_bodies
- empty_statements
- eol_at_end_of_file
- exhaustive_cases
- file_names
- hash_and_equals
- library_names
- lines_longer_than_80_chars
- literal_only_boolean_expressions
- missing_whitespace_between_adjacent_strings
- no_default_cases
- no_duplicate_case_values
- no_leading_underscores_for_local_identifiers
- no_runtimeType_toString
- non_constant_identifier_names
- only_throw_errors
- prefer_adjacent_string_concatenation
- prefer_asserts_with_message
- prefer_const_constructors_in_immutables
- prefer_const_declarations
- prefer_contains
- prefer_expression_function_bodies
- prefer_final_in_for_each
- prefer_final_locals
- prefer_if_null_operators
- prefer_initializing_formals
- prefer_is_empty
- prefer_is_not_empty
- prefer_is_not_operator
- prefer_iterable_whereType
- prefer_void_to_null
- recursive_getters
- require_trailing_commas
- slash_for_doc_comments
- unawaited_futures
- unnecessary_await_in_return
- unnecessary_brace_in_string_interps
- unnecessary_const
- unnecessary_late
- unnecessary_new
- unnecessary_nullable_for_final_variable_declarations
- unnecessary_overrides
- unnecessary_parenthesis
- unnecessary_raw_strings
- unnecessary_statements
- unnecessary_string_interpolations
- unnecessary_this
- unrelated_type_equality_checks
- use_build_context_synchronously
- use_if_null_to_convert_nulls_to_bools
- use_key_in_widget_constructors
- valid_regexps

dart_code_metrics:
anti-patterns:
- long-method
- long-parameter-list
metrics:
cyclomatic-complexity: 20
maximum-nesting-level: 5
number-of-parameters: 4
source-lines-of-code: 50
metrics-exclude:
- test/**
rules:
- avoid-nested-conditional-expressions
- avoid-passing-async-when-sync-expected
- avoid-redundant-async
- no-boolean-literal-compare
- no-empty-block
- no-equal-then-else
- no-object-declaration
- prefer-conditional-expressions
- prefer-first
- prefer-immediate-return
- prefer-last
- prefer-moving-to-variable:
allowed-duplicated-chains: 3
- prefer-trailing-comma



# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options
analyzer:
exclude:
- '**/*.freezed.dart'
- '**/*.g.dart'
- '**/*.gen.dart'
- '**/*.gr.dart'
- 'bricks'
- 'lib/generated_plugin_registrant.dart'
errors:
invalid_annotation_target: ignore
include: ../analysis_options.yaml
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions catalog/example/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include: ../../analysis_options.yaml
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
34 changes: 34 additions & 0 deletions catalog/example/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: gallery
description: A new Flutter project.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
version: 1.0.0+1

environment:
sdk: '>=3.0.0 <4.0.0'
flutter: 3.13.9

# Dependencies specify other packages that your package needs in order to work.
# To automatically upgrade your package dependencies to the latest versions
# consider running `flutter pub upgrade --major-versions`. Alternatively,
# dependencies can be manually updated by changing the version numbers below to
# the latest version available on pub.dev. To see which dependencies have newer
# versions available, run `flutter pub outdated`.
dependencies:
flutter:
sdk: flutter
catalog:
path: ../../catalog

cupertino_icons: 1.0.2
auto_route: 7.8.3
flutter_screenutil: 5.9.0
material_color_generator: 1.1.0
google_fonts: 5.1.0

dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: 2.0.0
auto_route_generator: 7.3.1
flutter_gen_runner: 5.3.1
build_runner: 2.4.6
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
138 changes: 0 additions & 138 deletions catalog/gallery/analysis_options.yaml

This file was deleted.

52 changes: 0 additions & 52 deletions catalog/gallery/pubspec.yaml

This file was deleted.

10 changes: 0 additions & 10 deletions catalog/test/catalog_test.dart
Original file line number Diff line number Diff line change
@@ -1,12 +1,2 @@
import 'package:flutter_test/flutter_test.dart';

import 'package:catalog/catalog.dart';

void main() {
test('adds one to input values', () {
final calculator = Calculator();
expect(calculator.addOne(2), 3);
expect(calculator.addOne(-7), -6);
expect(calculator.addOne(0), 1);
});
}
2 changes: 1 addition & 1 deletion fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ lane :lint_analyze do
flutter_command(command: "analyze lib")
flutter_command(command: "--version")
flutter_command(command: "analyze catalog")
flutter_command(command: "analyze catalog/gallery")
flutter_command(command: "analyze catalog/example")
end

desc "**Lint: Code metrics**"
Expand Down

0 comments on commit 0fc8403

Please sign in to comment.