Skip to content

Commit

Permalink
Update changelog & add better suggestion/context to avoid_debug_print…
Browse files Browse the repository at this point in the history
…_rule
  • Loading branch information
illia-romanenko committed Apr 22, 2024
1 parent dde8e6f commit 4fd6557
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
- Added `avoid_final_with_getter` rule
- Improve `avoid_late_keyword` - `ignored_types` to support ignoring subtype of the node type (https://github.com/solid-software/solid_lints/issues/157)
- Abstract methods should be omitted by `proper_super_calls` (https://github.com/solid-software/solid_lints/issues/159)
- Add a rule prefer_guard_clause for reversing nested if statements (https://github.com/solid-software/solid_lints/issues/91)
- add exclude params support to avoid_returning_widgets rule (https://github.com/solid-software/solid_lints/issues/131)
- add quick fix to avoid_final_with_getter (https://github.com/solid-software/solid_lints/pull/164)


## 0.1.5
Expand Down
10 changes: 8 additions & 2 deletions lib/src/lints/avoid_debug_print/avoid_debug_print_rule.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import 'package:solid_lints/src/models/solid_lint_rule.dart';
/// A `avoid_debug_print` rule which forbids calling or referencing
/// debugPrint function from flutter/foundation.
///
/// See more here: https://github.com/flutter/flutter/issues/147141
///
/// ### Example
///
/// #### BAD:
Expand All @@ -23,8 +25,12 @@ import 'package:solid_lints/src/models/solid_lint_rule.dart';
/// #### GOOD:
///
/// ```dart
/// log('');
/// if (kDebugMode) {
/// debugPrint('');
/// }
/// ```
///
///
class AvoidDebugPrint extends SolidLintRule {
/// The [LintCode] of this lint rule that represents
/// the error when debugPrint is called
Expand Down Expand Up @@ -96,7 +102,7 @@ class AvoidDebugPrint extends SolidLintRule {
}
}

/// Returns null if doesnt have right operand
/// Returns null if doesn't have right operand
SyntacticEntity? _getRightOperand(List<SyntacticEntity> entities) {
/// Example var t = 15; 15 is in 3d position
if (entities.length < 3) {
Expand Down

0 comments on commit 4fd6557

Please sign in to comment.