From ddbd2d16b1d5f1999705b9f55e84d285a46d2700 Mon Sep 17 00:00:00 2001 From: Max Korbel Date: Fri, 21 Jun 2024 15:45:56 -0700 Subject: [PATCH] Update analysis options, lint cleanup, sdk workaround removal (#495) --- analysis_options.yaml | 4 +++- lib/src/modules/gates.dart | 2 +- lib/src/selection.dart | 4 ++-- lib/src/signals/logic.dart | 2 +- lib/src/signals/logic_array.dart | 2 +- lib/src/utilities/simcompare.dart | 2 +- lib/src/values/logic_value.dart | 2 +- test/translations_test.dart | 8 +------- 8 files changed, 11 insertions(+), 15 deletions(-) diff --git a/analysis_options.yaml b/analysis_options.yaml index a76d4c4fe..1f19cfe6e 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -36,7 +36,7 @@ linter: - avoid_function_literals_in_foreach_calls - avoid_implementing_value_types - avoid_init_to_null - # - avoid_js_rounded_ints + - avoid_js_rounded_ints - avoid_multiple_declarations_per_line - avoid_null_checks_in_equality_operators - avoid_positional_boolean_parameters @@ -102,6 +102,7 @@ linter: - lines_longer_than_80_chars - 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 @@ -193,6 +194,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 diff --git a/lib/src/modules/gates.dart b/lib/src/modules/gates.dart index 6a24914e4..73e7ec89c 100644 --- a/lib/src/modules/gates.dart +++ b/lib/src/modules/gates.dart @@ -619,7 +619,7 @@ class LShift extends _ShiftGate { /// Performs a multiplexer/ternary operation. /// /// This is equivalent to something like: -/// ``` +/// ```SystemVerilog /// control ? d1 : d0 /// ``` Logic mux(Logic control, Logic d1, Logic d0) => Mux(control, d1, d0).out; diff --git a/lib/src/selection.dart b/lib/src/selection.dart index 819b9d3db..2d4649968 100644 --- a/lib/src/selection.dart +++ b/lib/src/selection.dart @@ -1,4 +1,4 @@ -// Copyright (C) 2023 Intel Corporation +// Copyright (C) 2023-2024 Intel Corporation // SPDX-License-Identifier: BSD-3-Clause // // selection.dart @@ -21,7 +21,7 @@ extension IndexedLogic on List { /// Alternatively we can approach this with `index.selectFrom(logicList)` /// /// Example: - /// ``` + /// ```dart /// // ordering matches closer to array indexing with `0` index-based. /// List logicList = [/* Add your Logic elements here */]; /// selected <= logicList.selectIndex(index); diff --git a/lib/src/signals/logic.dart b/lib/src/signals/logic.dart index d337434f1..3629d7396 100644 --- a/lib/src/signals/logic.dart +++ b/lib/src/signals/logic.dart @@ -800,7 +800,7 @@ class Logic { /// Alternatively we can approach this with `busList.selectIndex(index)` /// /// Example: - /// ``` + /// ```dart /// // ordering matches closer to array indexing with `0` index-based. /// selected <= index.selectFrom(busList); /// ``` diff --git a/lib/src/signals/logic_array.dart b/lib/src/signals/logic_array.dart index c1784c765..9e4d84dcd 100644 --- a/lib/src/signals/logic_array.dart +++ b/lib/src/signals/logic_array.dart @@ -242,7 +242,7 @@ class LogicArray extends LogicStructure { /// to the length of the [updatedSubset]. /// /// Example: - /// ``` + /// ```dart /// LogicArray sampleLogic; /// // Note: updatedSubset.length < (sampleLogic.length - start) /// List updatedSubset; diff --git a/lib/src/utilities/simcompare.dart b/lib/src/utilities/simcompare.dart index 44b6659e3..1b7a847a1 100644 --- a/lib/src/utilities/simcompare.dart +++ b/lib/src/utilities/simcompare.dart @@ -380,7 +380,7 @@ abstract class SimCompare { } return line; }) - .whereNotNull() + .nonNulls .join('\n'); if (maskedOutput.isNotEmpty) { print(maskedOutput); diff --git a/lib/src/values/logic_value.dart b/lib/src/values/logic_value.dart index e7b3390fb..d0d5bbc3a 100644 --- a/lib/src/values/logic_value.dart +++ b/lib/src/values/logic_value.dart @@ -870,7 +870,7 @@ abstract class LogicValue implements Comparable { /// Bitwise tristate merge. No width comparison. /// /// Truth table for reference: - /// ``` + /// ```csv /// s0 value0 invalid0 s1 value1 invalid1 result value invalid /// 0 0 0 0 0 0 0 0 0 /// 0 0 0 1 1 0 x 0 1 diff --git a/test/translations_test.dart b/test/translations_test.dart index d656fde96..6d53d4f74 100644 --- a/test/translations_test.dart +++ b/test/translations_test.dart @@ -1,4 +1,4 @@ -// Copyright (C) 2021-2023 Intel Corporation +// Copyright (C) 2021-2024 Intel Corporation // SPDX-License-Identifier: BSD-3-Clause // // translations_test.dart @@ -9,12 +9,6 @@ // ignore_for_file: avoid_multiple_declarations_per_line -// TODO(mkorbel1): reenable this test on JavaScript pending dart sdk issue, -// https://github.com/dart-lang/sdk/issues/54329. - -@TestOn('vm') -library; - import 'package:rohd/rohd.dart'; import 'package:rohd/src/utilities/simcompare.dart'; import 'package:test/test.dart';