mirror of
https://github.com/rust-lang/rust-clippy
synced 2025-02-17 06:28:42 +00:00
feat: add Default to Lint groups
This commit is contained in:
parent
272bbfb857
commit
1688368b33
2 changed files with 21 additions and 2 deletions
|
@ -448,6 +448,12 @@ Otherwise, have a great day =^.^=
|
||||||
None
|
None
|
||||||
</label>
|
</label>
|
||||||
</li>
|
</li>
|
||||||
|
<li class="checkbox">
|
||||||
|
<label ng-click="resetGroupsToDefault()">
|
||||||
|
<input type="checkbox" class="invisible" />
|
||||||
|
Default
|
||||||
|
</label>
|
||||||
|
</li>
|
||||||
<li role="separator" class="divider"></li>
|
<li role="separator" class="divider"></li>
|
||||||
<li class="checkbox" ng-repeat="(group, enabled) in groups">
|
<li class="checkbox" ng-repeat="(group, enabled) in groups">
|
||||||
<label class="text-capitalize">
|
<label class="text-capitalize">
|
||||||
|
|
|
@ -114,7 +114,7 @@
|
||||||
return $scope.levels[lint.level];
|
return $scope.levels[lint.level];
|
||||||
};
|
};
|
||||||
|
|
||||||
var GROUPS_FILTER_DEFAULT = {
|
const GROUPS_FILTER_DEFAULT = {
|
||||||
cargo: true,
|
cargo: true,
|
||||||
complexity: true,
|
complexity: true,
|
||||||
correctness: true,
|
correctness: true,
|
||||||
|
@ -125,8 +125,12 @@
|
||||||
restriction: true,
|
restriction: true,
|
||||||
style: true,
|
style: true,
|
||||||
suspicious: true,
|
suspicious: true,
|
||||||
|
}
|
||||||
|
|
||||||
|
$scope.groups = {
|
||||||
|
...GROUPS_FILTER_DEFAULT
|
||||||
};
|
};
|
||||||
$scope.groups = GROUPS_FILTER_DEFAULT;
|
|
||||||
const THEMES_DEFAULT = {
|
const THEMES_DEFAULT = {
|
||||||
light: "Light",
|
light: "Light",
|
||||||
rust: "Rust",
|
rust: "Rust",
|
||||||
|
@ -164,6 +168,15 @@
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
$scope.resetGroupsToDefault = function () {
|
||||||
|
const groups = $scope.groups;
|
||||||
|
for (const [key, value] of Object.entries(GROUPS_FILTER_DEFAULT)) {
|
||||||
|
if (groups.hasOwnProperty(key)) {
|
||||||
|
groups[key] = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
$scope.selectedValuesCount = function (obj) {
|
$scope.selectedValuesCount = function (obj) {
|
||||||
return Object.values(obj).filter(x => x).length;
|
return Object.values(obj).filter(x => x).length;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue