Skip to content

Commit

Permalink
chore: Update rules (#1)
Browse files Browse the repository at this point in the history
ci: Add release please
  • Loading branch information
thelukewalton authored Jan 2, 2025
1 parent 089bc73 commit 0fdb0e1
Show file tree
Hide file tree
Showing 10 changed files with 139 additions and 11 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @ZebraDevs/front-end-devs @thelukewalton @ps9310 @mikecoomber
17 changes: 17 additions & 0 deletions .github/workflows/on-main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: CI - On Main
on:
push:
branches:
- main

permissions:
contents: write
pull-requests: write

jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: googleapis/release-please-action@v4
with:
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
29 changes: 29 additions & 0 deletions .github/workflows/on-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: CI - On Release
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+*"

jobs:
check-package:
runs-on: ubuntu-latest
permissions:
id-token: write
environment: pub.dev
steps:
- uses: actions/checkout@v4
- uses: dart-lang/setup-dart@v1
- name: Install Flutter
uses: subosito/flutter-action@v2
with:
cache: true
channel: stable
flutter-version: 3.27.x
- name: Install dependencies
run: flutter pub get
- name: Format code
run: dart format --fix .
- name: Check Publish Warnings
run: dart pub publish --dry-run
- name: Publish
run: dart pub publish --force
3 changes: 3 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "1.0.0"
}
20 changes: 12 additions & 8 deletions lib/all_lint_rules.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# Retrieved from https://dart.dev/tools/linter-rules/all 05-Oct-23
# TODO: Automate this
# Retrieved from https://dart.dev/tools/linter-rules/all 02-Jan-25
# TODO(UX-1354): Automate this

linter:
rules:
- always_declare_return_types
- always_put_control_body_on_new_line
- always_put_required_named_parameters_first
- always_require_non_null_named_parameters
- always_specify_types
- always_use_package_imports
- annotate_overrides
- annotate_redeclares
- avoid_annotating_with_dynamic
- avoid_bool_literals_in_conditional_expressions
- avoid_catches_without_on_clauses
Expand All @@ -23,6 +23,7 @@ linter:
- avoid_field_initializers_in_const_classes
- avoid_final_parameters
- avoid_function_literals_in_foreach_calls
- avoid_futureor_void
- avoid_implementing_value_types
- avoid_init_to_null
- avoid_js_rounded_ints
Expand All @@ -35,8 +36,6 @@ linter:
- 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_setters_without_getters
Expand Down Expand Up @@ -72,6 +71,7 @@ linter:
- directives_ordering
- discarded_futures
- do_not_use_environment
- document_ignores
- empty_catches
- empty_constructor_bodies
- empty_statements
Expand All @@ -84,17 +84,17 @@ linter:
- implicit_call_tearoffs
- implicit_reopen
- invalid_case_patterns
- iterable_contains_unrelated_type
- invalid_runtime_check_with_js_interop_types
- join_return_with_assignment
- leading_newlines_in_multiline_strings
- library_annotations
- library_names
- library_prefixes
- library_private_types_in_public_api
- lines_longer_than_80_chars
- list_remove_unrelated_type
- literal_only_boolean_expressions
- matching_super_parameters
- missing_code_block_language_in_doc_comment
- missing_whitespace_between_adjacent_strings
- no_adjacent_strings_in_list
- no_default_cases
Expand All @@ -111,6 +111,7 @@ linter:
- null_check_on_nullable_type_parameter
- null_closures
- omit_local_variable_types
- omit_obvious_local_variable_types
- one_member_abstracts
- only_throw_errors
- overridden_fields
Expand Down Expand Up @@ -169,13 +170,15 @@ linter:
- sort_constructors_first
- sort_pub_dependencies
- sort_unnamed_constructors_first
- specify_nonobvious_local_variable_types
- test_types_in_equals
- throw_in_finally
- tighten_type_of_initializing_formals
- type_annotate_public_apis
- type_init_formals
- type_literal_in_constant_pattern
- unawaited_futures
- unintended_html_in_doc_comment
- unnecessary_await_in_return
- unnecessary_brace_in_string_interps
- unnecessary_breaks
Expand All @@ -186,6 +189,7 @@ linter:
- unnecessary_lambdas
- unnecessary_late
- unnecessary_library_directive
- unnecessary_library_name
- unnecessary_new
- unnecessary_null_aware_assignments
- unnecessary_null_aware_operator_on_extension_on_nullable
Expand All @@ -202,7 +206,6 @@ linter:
- unnecessary_to_list_in_spreads
- unreachable_from_main
- unrelated_type_equality_checks
- unsafe_html
- use_build_context_synchronously
- use_colored_box
- use_decorated_box
Expand All @@ -222,5 +225,6 @@ linter:
- use_super_parameters
- use_test_throws_matchers
- use_to_and_as_if_applicable
- use_truncating_division
- valid_regexps
- void_checks
5 changes: 4 additions & 1 deletion lib/analysis_options.3.1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -197,4 +197,7 @@ linter:
- use_test_throws_matchers
- use_to_and_as_if_applicable
- valid_regexps
- void_checks
- void_checks
- invalid_runtime_check_with_js_interop_types
- unintended_html_in_doc_comment
- unnecessary_library_name
2 changes: 2 additions & 0 deletions lib/analysis_options_lib.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,5 @@ linter:
unnecessary_final: false
avoid_annotating_with_dynamic: false
avoid_catches_without_on_clauses: false
specify_nonobvious_local_variable_types: false
omit_obvious_local_variable_types: false
8 changes: 7 additions & 1 deletion lib/analysis_options_strict.3.1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -202,4 +202,10 @@ linter:
- use_test_throws_matchers
- use_to_and_as_if_applicable
- valid_regexps
- void_checks
- void_checks
- document_ignores
- invalid_runtime_check_with_js_interop_types
- missing_code_block_language_in_doc_comment
- unintended_html_in_doc_comment
- unnecessary_library_name
- use_truncating_division
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: zds_analysis
description: Lint rules for Dart and Flutter used internally at Zebra Technologies
homepage: https://github.com/ZebraDevs/zds_analysis
repository: https://github.com/ZebraDevs/zds_analysis
issue_tracker: https://github.com/zebradevs/zds_analysis/issues
issue_tracker: https://github.com/ZebraDevs/zds_analysis
version: 1.0.0

environment:
Expand Down
63 changes: 63 additions & 0 deletions release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{
"packages": {
".": {
"release-type": "dart"
}
},
"include-component-in-tag": false,
"changelog-sections": [
{
"type": "feat",
"section": "✨ New Features"
},
{
"type": "fix",
"section": "🪲 Bug Fixes"
},
{
"type": "revert",
"section": "👀 Reverts"
},
{
"type": "docs",
"section": "📈 Documentation"
},
{
"type": "deps",
"section": "⛓️ Dependencies"
},
{
"type": "test",
"section": "🧪 Tests"
},
{
"type": "chore",
"section": "🧹 Miscellaneous Chores"
},
{
"type": "perf",
"section": "Performance Improvements",
"hidden": true
},
{
"type": "refactor",
"section": "Code Refactoring",
"hidden": true
},
{
"type": "style",
"section": "Styles",
"hidden": true
},
{
"type": "build",
"section": "Build System",
"hidden": true
},
{
"type": "ci",
"section": "Continuous Integration",
"hidden": true
}
]
}

0 comments on commit 0fdb0e1

Please sign in to comment.