Skip to content
This repository was archived by the owner on Nov 20, 2024. It is now read-only.

Error group. #90

Merged
merged 1 commit into from
May 11, 2015
Merged
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
8 changes: 6 additions & 2 deletions lib/src/linter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ class FileGlobFilter extends LintFilter {
class Group implements Comparable<Group> {

/// Defined rule groups.
static const Group errors =
const Group._('errors', description: 'Possible coding errors.');
static const Group pub = const Group._('pub',
description: 'Pub-related rules.',
link: const Hyperlink('See the <strong>Pubspec Format</strong>',
Expand All @@ -108,10 +110,12 @@ class Group implements Comparable<Group> {

factory Group(String name, {String description: '', Hyperlink link}) {
switch (name.toLowerCase()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You might want a Map here rather than a hard-coded list of group names.

case 'style':
return style;
case 'errors':
return errors;
case 'pub':
return pub;
case 'style':
return style;
default:
return new Group._(name,
custom: true, description: description, link: link);
Expand Down