Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/github_actions/github-actions-9c5…
Browse files Browse the repository at this point in the history
…4b75f35
  • Loading branch information
kevmoo authored Jul 16, 2024
2 parents db45e45 + ed25f7a commit 8a96a40
Show file tree
Hide file tree
Showing 55 changed files with 393 additions and 434 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/changelog_reminder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ jobs:
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- name: Check changed files
run: |
git fetch origin master
PR_DIFF=$(git diff origin/master --name-only)
git fetch origin main
PR_DIFF=$(git diff origin/main --name-only)
echo "$PR_DIFF"
if [[ $PR_DIFF == *"CHANGELOG.md"* ]]; then
echo "CHANGELOG.md has been updated."
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dcm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
pull_request:
types: [synchronize, opened, reopened]
branches:
- master
- main

jobs:
dcm:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: Publish

on:
pull_request:
branches: [ master ]
branches: [ main ]
types: [opened, synchronize, reopened, labeled, unlabeled]
push:
tags: [ '[A-z]+-v[0-9]+.[0-9]+.[0-9]+*' ]
Expand Down
105 changes: 105 additions & 0 deletions _analysis_config/lib/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
# Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.

include: package:lints/recommended.yaml

analyzer:
# language:
# strict-casts: true
errors:
dead_code: error
unused_element: error
unused_import: error
unused_local_variable: error

linter:
rules:
- always_declare_return_types
- avoid_classes_with_only_static_members
- avoid_returning_this
- avoid_unused_constructor_parameters
- avoid_void_async
- cancel_subscriptions
- directives_ordering
- join_return_with_assignment
- library_names
- literal_only_boolean_expressions
- package_api_docs
- package_prefixed_library_names
# - prefer_final_locals
# - prefer_relative_imports
- prefer_single_quotes
- prefer_void_to_null
- test_types_in_equals
- throw_in_finally
- omit_local_variable_types
- only_throw_errors
- unawaited_futures
- unnecessary_lambdas
- unnecessary_parenthesis
- unnecessary_statements

# TODO(https://github.com/dart-lang/webdev/issues/2053): Enable commented-out rules with fixes.
dart_code_metrics:
metrics:
# cyclomatic-complexity: 20 # Enable.
# number-of-parameters: 5 # Enable.
# maximum-nesting-level: 5 # Enable.
metrics-exclude:
- test/**
rules:
# - arguments-ordering
# - avoid-banned-imports
- avoid-cascade-after-if-null
- avoid-collection-methods-with-unrelated-types
# - avoid-double-slash-imports
- avoid-duplicate-exports
# - avoid-dynamic
# - avoid-global-state # Enable.
# - avoid-ignoring-return-values
# - avoid-late-keyword
- avoid-missing-enum-constant-in-map
- avoid-nested-conditional-expressions
- avoid-non-ascii-symbols
# - avoid-non-null-assertion # Enable.
# - avoid-passing-async-when-sync-expected # Enable.
- avoid-redundant-async
# - avoid-throw-in-catch-block # Enable.
# - avoid-top-level-members-in-tests
# - avoid-unnecessary-conditionals
- avoid-unnecessary-type-assertions
- avoid-unnecessary-type-casts
- avoid-unrelated-type-assertions
- avoid-unused-parameters
# - ban-name
- binary-expression-operand-order
- double-literal-format
# - format-comment # Enable.
# - list-all-equatable-fields
# - member-ordering # Enable.
# - missing-test-assertion
# - new-line-before-return
- no-boolean-literal-compare
# - no-empty-block # Enable.
# - no-equal-arguments
- no-equal-then-else
# - no-magic-number
# - no-object-declaration
# - prefer-async-await # Enable.
# - prefer-commenting-analyzer-ignores # Enable.
# - prefer-conditional-expressions
# - prefer-correct-identifier-length
# - prefer-correct-test-file-name # Enable.
- prefer-correct-type-name
- prefer-enums-by-name
# - prefer-first
# - prefer-immediate-return # Enable.
- prefer-iterable-of
- prefer-last
# - prefer-match-file-name
# - prefer-moving-to-variable: # Enable.
# allow-duplicated-chains: 2
# - prefer-static-class
# - prefer-trailing-comma
# - tag-name
10 changes: 10 additions & 0 deletions _analysis_config/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: analysis_config
description: The shared analysis configuration for the webdev packages.

publish_to: none

environment:
sdk: ^3.1.0

dependencies:
lints: ^4.0.0
106 changes: 0 additions & 106 deletions analysis_options.yaml

This file was deleted.

73 changes: 1 addition & 72 deletions dwds/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
# This file contains the analysis options used for code in the webdev
# repository.

include: package:lints/recommended.yaml
include: package:analysis_config/analysis_options.yaml

analyzer:
exclude:
Expand All @@ -13,73 +10,5 @@ analyzer:
linter:
rules:
- always_use_package_imports
- avoid_void_async
- directives_ordering
- prefer_final_locals
- require_trailing_commas
- unawaited_futures
- unnecessary_lambdas

# TODO(https://github.com/dart-lang/webdev/issues/2053): Enable commented-out rules with fixes.
dart_code_metrics:
metrics:
# cyclomatic-complexity: 20 # Enable.
# number-of-parameters: 5 # Enable.
# maximum-nesting-level: 5 # Enable.
metrics-exclude:
- test/**
rules:
# - arguments-ordering
# - avoid-banned-imports
- avoid-cascade-after-if-null
- avoid-collection-methods-with-unrelated-types
# - avoid-double-slash-imports
- avoid-duplicate-exports
# - avoid-dynamic
# - avoid-global-state # Enable.
# - avoid-ignoring-return-values
# - avoid-late-keyword
- avoid-missing-enum-constant-in-map
- avoid-nested-conditional-expressions
- avoid-non-ascii-symbols
# - avoid-non-null-assertion # Enable.
# - avoid-passing-async-when-sync-expected # Enable.
- avoid-redundant-async
# - avoid-throw-in-catch-block # Enable.
# - avoid-top-level-members-in-tests
# - avoid-unnecessary-conditionals
- avoid-unnecessary-type-assertions
- avoid-unnecessary-type-casts
- avoid-unrelated-type-assertions
- avoid-unused-parameters
# - ban-name
- binary-expression-operand-order
- double-literal-format
# - format-comment # Enable.
# - list-all-equatable-fields
# - member-ordering # Enable.
# - missing-test-assertion
# - new-line-before-return
- no-boolean-literal-compare
# - no-empty-block # Enable.
# - no-equal-arguments
- no-equal-then-else
# - no-magic-number
# - no-object-declaration
# - prefer-async-await # Enable.
# - prefer-commenting-analyzer-ignores # Enable.
# - prefer-conditional-expressions
# - prefer-correct-identifier-length
# - prefer-correct-test-file-name # Enable.
- prefer-correct-type-name
- prefer-enums-by-name
# - prefer-first
# - prefer-immediate-return # Enable.
- prefer-iterable-of
- prefer-last
# - prefer-match-file-name
# - prefer-moving-to-variable: # Enable.
# allow-duplicated-chains: 2
# - prefer-static-class
# - prefer-trailing-comma
# - tag-name
10 changes: 5 additions & 5 deletions dwds/debug_extension/tool/copy_builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ Builder copyBuilder(_) => _CopyBuilder();
class _CopyBuilder extends Builder {
@override
Map<String, List<String>> get buildExtensions => {
"web/{{}}.dart.js": ["compiled/{{}}.dart.js"],
"web/static_assets/{{}}.png": ["compiled/static_assets/{{}}.png"],
"web/static_assets/{{}}.html": ["compiled/static_assets/{{}}.html"],
"web/static_assets/{{}}.css": ["compiled/static_assets/{{}}.css"],
"web/manifest.json": ["compiled/manifest.json"],
'web/{{}}.dart.js': ['compiled/{{}}.dart.js'],
'web/static_assets/{{}}.png': ['compiled/static_assets/{{}}.png'],
'web/static_assets/{{}}.html': ['compiled/static_assets/{{}}.html'],
'web/static_assets/{{}}.css': ['compiled/static_assets/{{}}.css'],
'web/manifest.json': ['compiled/manifest.json'],
};

@override
Expand Down
4 changes: 2 additions & 2 deletions dwds/debug_extension/tool/update_dev_files.dart
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ String _newKeyValue({

extension LeftPaddingExtension on String {
String leftPadding() {
String padding = '';
int idx = 0;
var padding = '';
var idx = 0;
while (idx < length && this[idx] == ' ') {
padding += ' ';
idx++;
Expand Down
4 changes: 2 additions & 2 deletions dwds/debug_extension/web/debug_session.dart
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ void _registerDebugEventListeners() {
);
}

_enableExecutionContextReporting(int tabId) {
void _enableExecutionContextReporting(int tabId) {
// Runtime.enable enables reporting of execution contexts creation by means of
// executionContextCreated event. When the reporting gets enabled the event
// will be sent immediately for each existing execution context:
Expand Down Expand Up @@ -299,7 +299,7 @@ Future<void> _maybeConnectToDwds(int tabId, Object? params) async {
final context = json.decode(JSON.stringify(params))['context'];
final contextOrigin = context['origin'] as String?;
if (contextOrigin == null) return;
if (contextOrigin.contains(('chrome-extension:'))) return;
if (contextOrigin.contains('chrome-extension:')) return;
final debugInfo = await fetchStorageObject<DebugInfo>(
type: StorageObject.debugInfo,
tabId: tabId,
Expand Down
Loading

0 comments on commit 8a96a40

Please sign in to comment.