-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added
exclude
configuration to the number_of_parameters
rule
- Loading branch information
Showing
5 changed files
with
33 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
lib/src/lints/number_of_parameters/models/number_of_parameters_parameters.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,26 @@ | ||
import 'package:solid_lints/src/models/ignored_entities_model/ignored_entities_model.dart'; | ||
|
||
/// A data model class that represents the "number of parameters" input | ||
/// parameters. | ||
class NumberOfParametersParameters { | ||
/// Maximum number of parameters allowed before a warning is triggered. | ||
final int maxParameters; | ||
|
||
/// The methods/classes that this lint should ignore. | ||
final IgnoredEntitiesModel ignoredEntitiesModel; | ||
|
||
static const _defaultMaxParameters = 2; | ||
|
||
/// Constructor for [NumberOfParametersParameters] model | ||
const NumberOfParametersParameters({ | ||
required this.maxParameters, | ||
required this.ignoredEntitiesModel, | ||
}); | ||
|
||
/// Method for creating from json data | ||
factory NumberOfParametersParameters.fromJson(Map<String, Object?> json) => | ||
NumberOfParametersParameters( | ||
maxParameters: json['max_parameters'] as int? ?? _defaultMaxParameters, | ||
ignoredEntitiesModel: IgnoredEntitiesModel.fromJson(json), | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
analyzer: | ||
plugins: | ||
- ../custom_lint | ||
|
||
custom_lint: | ||
rules: | ||
- number_of_parameters: | ||
exclude: | ||
- method_name: excludeMethod | ||
class_name: ExcludeClass | ||
- method_name: excludeFunction | ||
- class_name: ExcludeEntireClass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters