Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: [DX-3888] Update ruleset #728

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/dcm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
uses: CQLabs/setup-dcm@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
version: "1.26.1"
version: "1.26.2"

- uses: ./.github/actions/setup

Expand Down
4 changes: 2 additions & 2 deletions mews_pedantic/lib/analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ dart_code_metrics:
# - prefer-assigning-await-expressions
# - prefer-async-await
- prefer-boolean-prefixes:
prefixes: [ is, are, was, were, has, have, had, can, should, will, do, does, did, allow, show, use, hide, only, enable ]
prefixes: [ is, are, was, were, has, have, had, can, should, will, do, does, did, allow, show, use, hide, only, enable, contains ]
- prefer-both-inlining-annotations
# - prefer-bytes-builder
# - prefer-class-destructuring
Expand Down Expand Up @@ -515,7 +515,7 @@ dart_code_metrics:
# - prefer-single-declaration-per-file
- prefer-specific-cases-first
# - prefer-static-class
# - prefer-static-method
- prefer-static-method
- prefer-switch-expression
- prefer-switch-with-enums
- prefer-switch-with-sealed-classes
Expand Down
2 changes: 2 additions & 0 deletions optimus/lib/src/chat/chat.dart
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,12 @@ class OptimusChat extends StatelessWidget {
nextMessageTime.difference(_currentMessageTime(index)).inDays > 1;
}

// ignore: prefer-static-method, ignore until private methods could be ignored in the DCM rule
bool _isLatestMessage(int index) => index == 0;

bool _isOldestMessage(int index) => index + 1 == _messages.length;

// ignore: prefer-static-method, ignore until private methods could be ignored in the DCM rule
int _byTime(OptimusMessage m1, OptimusMessage m2) =>
m2.time.compareTo(m1.time);

Expand Down
1 change: 1 addition & 0 deletions optimus/lib/src/feedback/alert.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ class OptimusAlert extends StatelessWidget {

bool get _isExpanded => description != null || link != null;

// ignore: prefer-static-method, ignore until private methods could be ignored in the DCM rule
double _getPadding(BuildContext context) =>
switch (MediaQuery.sizeOf(context).screenBreakpoint) {
Breakpoint.small || Breakpoint.extraSmall => context.tokens.spacing100,
Expand Down
1 change: 1 addition & 0 deletions optimus/lib/src/form/date_formatter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class DateFormatter extends TextInputFormatter {
return index;
}

// ignore: prefer-static-method, ignore until private methods could be ignored in the DCM rule
String _replaceCharAt(String value, int index, String replacement) =>
value.substring(0, index) +
replacement +
Expand Down
2 changes: 2 additions & 0 deletions optimus/lib/src/form/date_input_field.dart
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ class _OptimusDateInputFieldState extends State<OptimusDateInputField>
_previousValue = _controller.text;
}

// ignore: prefer-static-method, ignore until private methods could be ignored in the DCM rule
DateTime? _getDateTime(DateFormat format, String value) {
if (value.isEmpty) return null;

Expand Down Expand Up @@ -157,6 +158,7 @@ class _OptimusDateInputFieldState extends State<OptimusDateInputField>
}
}

// ignore: prefer-static-method, ignore until private methods could be ignored in the DCM rule
String _replaceSupported(
String? value,
_SymbolConverter input,
Expand Down
1 change: 1 addition & 0 deletions optimus/lib/src/icon_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class OptimusIconList extends StatelessWidget {
);
}

// ignore: prefer-static-method, ignore until private methods could be ignored in the DCM rule
OptimusIconListSize _getListSize(BuildContext context) =>
switch (MediaQuery.sizeOf(context).screenBreakpoint) {
Breakpoint.extraSmall || Breakpoint.small => OptimusIconListSize.small,
Expand Down
1 change: 1 addition & 0 deletions optimus/lib/src/radio/radio_circle.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class RadioCircle extends StatelessWidget {
: tokens.borderInteractiveSecondaryDefault,
});

// ignore: prefer-static-method, ignore until private methods could be ignored in the DCM rule
WidgetStateColor _getFillColor(OptimusTokens tokens) =>
WidgetStateColor.fromMap({
WidgetState.disabled: tokens.backgroundInteractiveNeutralSubtleDefault,
Expand Down
1 change: 1 addition & 0 deletions optimus/lib/src/tabs.dart
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ class OptimusTabBar extends StatelessWidget {
final List<Widget> pages;
final TabController? tabController;

// ignore: prefer-static-method, ignore until private methods could be ignored in the DCM rule
Decoration _buildIndicator(OptimusTokens tokens) => UnderlineTabIndicator(
borderSide: BorderSide(
color: tokens.borderInteractivePrimaryDefault,
Expand Down