{"action":"created","comment":{"url":"https://api.github.com/repos/sass/linter/pulls/comments/241226224","pull_request_review_id":184444500,"id":241226224,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0MTIyNjIyNA==","diff_hunk":"@@ -0,0 +1,64 @@\n+// Copyright 2018 Google Inc. Use of this source code is governed by an\n+// MIT-style license that can be found in the LICENSE file or at\n+// https://opensource.org/licenses/MIT.\n+\n+import 'dart:io';\n+\n+import 'package:path/path.dart' as p;\n+import 'package:yaml/yaml.dart';\n+import 'package:sass_linter/src/engine.dart';\n+import 'package:sass_linter/src/exceptions.dart';\n+import 'package:sass_linter/src/rule.dart';\n+\n+class Configuration {\n+  /// An empty configuration with only default values.\n+  static final empty = Configuration._(null, <String>[]);\n+\n+  final List<Rule> rules;\n+  final List<String> paths;\n+\n+  static YamlMap _loadYamlMap(String source, String path) {\n+    var document = loadYamlNode(source, sourceUrl: p.toUri(path));\n+\n+    if (document is! Map) {\n+      throw ConfigParseException('The configuration file must be a Yaml map.');\n+    }\n+\n+    return document as YamlMap;\n+  }\n+\n+  factory Configuration.parse(String path) {\n+    var source = File(path).readAsStringSync();\n+    if (source.isEmpty) return Configuration.empty;\n+\n+    var document = Configuration._loadYamlMap(source, path);\n+    if (document.value == null) return Configuration.empty;\n+\n+    List<Rule> rules;\n+\n+    if (document.containsKey('rules')) {","path":"lib/src/configuration.dart","position":39,"original_position":39,"commit_id":"9b2adbf899bbcf260d73fa7a77243c8b42ec97b1","original_commit_id":"9b2adbf899bbcf260d73fa7a77243c8b42ec97b1","user":{"login":"nex3","id":188,"node_id":"MDQ6VXNlcjE4OA==","avatar_url":"https://avatars0.githubusercontent.com/u/188?v=4","gravatar_id":"","url":"https://api.github.com/users/nex3","html_url":"https://github.com/nex3","followers_url":"https://api.github.com/users/nex3/followers","following_url":"https://api.github.com/users/nex3/following{/other_user}","gists_url":"https://api.github.com/users/nex3/gists{/gist_id}","starred_url":"https://api.github.com/users/nex3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nex3/subscriptions","organizations_url":"https://api.github.com/users/nex3/orgs","repos_url":"https://api.github.com/users/nex3/repos","events_url":"https://api.github.com/users/nex3/events{/privacy}","received_events_url":"https://api.github.com/users/nex3/received_events","type":"User","site_admin":false},"body":"I generally like allowing `null` rules to have the default values as well, just to be a little more flexible for the user.","created_at":"2018-12-12T23:41:21Z","updated_at":"2018-12-12T23:46:30Z","html_url":"https://github.com/sass/linter/pull/34#discussion_r241226224","pull_request_url":"https://api.github.com/repos/sass/linter/pulls/34","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/sass/linter/pulls/comments/241226224"},"html":{"href":"https://github.com/sass/linter/pull/34#discussion_r241226224"},"pull_request":{"href":"https://api.github.com/repos/sass/linter/pulls/34"}}},"pull_request":{"url":"https://api.github.com/repos/sass/linter/pulls/34","id":237860148,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM3ODYwMTQ4","html_url":"https://github.com/sass/linter/pull/34","diff_url":"https://github.com/sass/linter/pull/34.diff","patch_url":"https://github.com/sass/linter/pull/34.patch","issue_url":"https://api.github.com/repos/sass/linter/issues/34","number":34,"state":"open","locked":false,"title":"Add new --config option supporting config files","user":{"login":"srawlins","id":103167,"node_id":"MDQ6VXNlcjEwMzE2Nw==","avatar_url":"https://avatars3.githubusercontent.com/u/103167?v=4","gravatar_id":"","url":"https://api.github.com/users/srawlins","html_url":"https://github.com/srawlins","followers_url":"https://api.github.com/users/srawlins/followers","following_url":"https://api.github.com/users/srawlins/following{/other_user}","gists_url":"https://api.github.com/users/srawlins/gists{/gist_id}","starred_url":"https://api.github.com/users/srawlins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/srawlins/subscriptions","organizations_url":"https://api.github.com/users/srawlins/orgs","repos_url":"https://api.github.com/users/srawlins/repos","events_url":"https://api.github.com/users/srawlins/events{/privacy}","received_events_url":"https://api.github.com/users/srawlins/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-12-11T23:15:32Z","updated_at":"2018-12-12T23:46:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9667893817ab0d5279630506d25e5e8e8c07ff3a","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/sass/linter/pulls/34/commits","review_comments_url":"https://api.github.com/repos/sass/linter/pulls/34/comments","review_comment_url":"https://api.github.com/repos/sass/linter/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sass/linter/issues/34/comments","statuses_url":"https://api.github.com/repos/sass/linter/statuses/9b2adbf899bbcf260d73fa7a77243c8b42ec97b1","head":{"label":"srawlins:config-file","ref":"config-file","sha":"9b2adbf899bbcf260d73fa7a77243c8b42ec97b1","user":{"login":"srawlins","id":103167,"node_id":"MDQ6VXNlcjEwMzE2Nw==","avatar_url":"https://avatars3.githubusercontent.com/u/103167?v=4","gravatar_id":"","url":"https://api.github.com/users/srawlins","html_url":"https://github.com/srawlins","followers_url":"https://api.github.com/users/srawlins/followers","following_url":"https://api.github.com/users/srawlins/following{/other_user}","gists_url":"https://api.github.com/users/srawlins/gists{/gist_id}","starred_url":"https://api.github.com/users/srawlins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/srawlins/subscriptions","organizations_url":"https://api.github.com/users/srawlins/orgs","repos_url":"https://api.github.com/users/srawlins/repos","events_url":"https://api.github.com/users/srawlins/events{/privacy}","received_events_url":"https://api.github.com/users/srawlins/received_events","type":"User","site_admin":false},"repo":{"id":137269123,"node_id":"MDEwOlJlcG9zaXRvcnkxMzcyNjkxMjM=","name":"linter-1","full_name":"srawlins/linter-1","private":false,"owner":{"login":"srawlins","id":103167,"node_id":"MDQ6VXNlcjEwMzE2Nw==","avatar_url":"https://avatars3.githubusercontent.com/u/103167?v=4","gravatar_id":"","url":"https://api.github.com/users/srawlins","html_url":"https://github.com/srawlins","followers_url":"https://api.github.com/users/srawlins/followers","following_url":"https://api.github.com/users/srawlins/following{/other_user}","gists_url":"https://api.github.com/users/srawlins/gists{/gist_id}","starred_url":"https://api.github.com/users/srawlins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/srawlins/subscriptions","organizations_url":"https://api.github.com/users/srawlins/orgs","repos_url":"https://api.github.com/users/srawlins/repos","events_url":"https://api.github.com/users/srawlins/events{/privacy}","received_events_url":"https://api.github.com/users/srawlins/received_events","type":"User","site_admin":false},"html_url":"https://github.com/srawlins/linter-1","description":"The official Sass linter","fork":true,"url":"https://api.github.com/repos/srawlins/linter-1","forks_url":"https://api.github.com/repos/srawlins/linter-1/forks","keys_url":"https://api.github.com/repos/srawlins/linter-1/keys{/key_id}","collaborators_url":"https://api.github.com/repos/srawlins/linter-1/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/srawlins/linter-1/teams","hooks_url":"https://api.github.com/repos/srawlins/linter-1/hooks","issue_events_url":"https://api.github.com/repos/srawlins/linter-1/issues/events{/number}","events_url":"https://api.github.com/repos/srawlins/linter-1/events","assignees_url":"https://api.github.com/repos/srawlins/linter-1/assignees{/user}","branches_url":"https://api.github.com/repos/srawlins/linter-1/branches{/branch}","tags_url":"https://api.github.com/repos/srawlins/linter-1/tags","blobs_url":"https://api.github.com/repos/srawlins/linter-1/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/srawlins/linter-1/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/srawlins/linter-1/git/refs{/sha}","trees_url":"https://api.github.com/repos/srawlins/linter-1/git/trees{/sha}","statuses_url":"https://api.github.com/repos/srawlins/linter-1/statuses/{sha}","languages_url":"https://api.github.com/repos/srawlins/linter-1/languages","stargazers_url":"https://api.github.com/repos/srawlins/linter-1/stargazers","contributors_url":"https://api.github.com/repos/srawlins/linter-1/contributors","subscribers_url":"https://api.github.com/repos/srawlins/linter-1/subscribers","subscription_url":"https://api.github.com/repos/srawlins/linter-1/subscription","commits_url":"https://api.github.com/repos/srawlins/linter-1/commits{/sha}","git_commits_url":"https://api.github.com/repos/srawlins/linter-1/git/commits{/sha}","comments_url":"https://api.github.com/repos/srawlins/linter-1/comments{/number}","issue_comment_url":"https://api.github.com/repos/srawlins/linter-1/issues/comments{/number}","contents_url":"https://api.github.com/repos/srawlins/linter-1/contents/{+path}","compare_url":"https://api.github.com/repos/srawlins/linter-1/compare/{base}...{head}","merges_url":"https://api.github.com/repos/srawlins/linter-1/merges","archive_url":"https://api.github.com/repos/srawlins/linter-1/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/srawlins/linter-1/downloads","issues_url":"https://api.github.com/repos/srawlins/linter-1/issues{/number}","pulls_url":"https://api.github.com/repos/srawlins/linter-1/pulls{/number}","milestones_url":"https://api.github.com/repos/srawlins/linter-1/milestones{/number}","notifications_url":"https://api.github.com/repos/srawlins/linter-1/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/srawlins/linter-1/labels{/name}","releases_url":"https://api.github.com/repos/srawlins/linter-1/releases{/id}","deployments_url":"https://api.github.com/repos/srawlins/linter-1/deployments","created_at":"2018-06-13T20:47:36Z","updated_at":"2018-10-25T21:07:31Z","pushed_at":"2018-12-11T23:14:43Z","git_url":"git://github.com/srawlins/linter-1.git","ssh_url":"git@github.com:srawlins/linter-1.git","clone_url":"https://github.com/srawlins/linter-1.git","svn_url":"https://github.com/srawlins/linter-1","homepage":null,"size":50,"stargazers_count":0,"watchers_count":0,"language":"Dart","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"sass:master","ref":"master","sha":"58f9ab42f504e90b1cf79962b0778a65295eae8b","user":{"login":"sass","id":317889,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMxNzg4OQ==","avatar_url":"https://avatars1.githubusercontent.com/u/317889?v=4","gravatar_id":"","url":"https://api.github.com/users/sass","html_url":"https://github.com/sass","followers_url":"https://api.github.com/users/sass/followers","following_url":"https://api.github.com/users/sass/following{/other_user}","gists_url":"https://api.github.com/users/sass/gists{/gist_id}","starred_url":"https://api.github.com/users/sass/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sass/subscriptions","organizations_url":"https://api.github.com/users/sass/orgs","repos_url":"https://api.github.com/users/sass/repos","events_url":"https://api.github.com/users/sass/events{/privacy}","received_events_url":"https://api.github.com/users/sass/received_events","type":"Organization","site_admin":false},"repo":{"id":135771446,"node_id":"MDEwOlJlcG9zaXRvcnkxMzU3NzE0NDY=","name":"linter","full_name":"sass/linter","private":false,"owner":{"login":"sass","id":317889,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMxNzg4OQ==","avatar_url":"https://avatars1.githubusercontent.com/u/317889?v=4","gravatar_id":"","url":"https://api.github.com/users/sass","html_url":"https://github.com/sass","followers_url":"https://api.github.com/users/sass/followers","following_url":"https://api.github.com/users/sass/following{/other_user}","gists_url":"https://api.github.com/users/sass/gists{/gist_id}","starred_url":"https://api.github.com/users/sass/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sass/subscriptions","organizations_url":"https://api.github.com/users/sass/orgs","repos_url":"https://api.github.com/users/sass/repos","events_url":"https://api.github.com/users/sass/events{/privacy}","received_events_url":"https://api.github.com/users/sass/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/sass/linter","description":"The official Sass linter","fork":false,"url":"https://api.github.com/repos/sass/linter","forks_url":"https://api.github.com/repos/sass/linter/forks","keys_url":"https://api.github.com/repos/sass/linter/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sass/linter/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sass/linter/teams","hooks_url":"https://api.github.com/repos/sass/linter/hooks","issue_events_url":"https://api.github.com/repos/sass/linter/issues/events{/number}","events_url":"https://api.github.com/repos/sass/linter/events","assignees_url":"https://api.github.com/repos/sass/linter/assignees{/user}","branches_url":"https://api.github.com/repos/sass/linter/branches{/branch}","tags_url":"https://api.github.com/repos/sass/linter/tags","blobs_url":"https://api.github.com/repos/sass/linter/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sass/linter/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sass/linter/git/refs{/sha}","trees_url":"https://api.github.com/repos/sass/linter/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sass/linter/statuses/{sha}","languages_url":"https://api.github.com/repos/sass/linter/languages","stargazers_url":"https://api.github.com/repos/sass/linter/stargazers","contributors_url":"https://api.github.com/repos/sass/linter/contributors","subscribers_url":"https://api.github.com/repos/sass/linter/subscribers","subscription_url":"https://api.github.com/repos/sass/linter/subscription","commits_url":"https://api.github.com/repos/sass/linter/commits{/sha}","git_commits_url":"https://api.github.com/repos/sass/linter/git/commits{/sha}","comments_url":"https://api.github.com/repos/sass/linter/comments{/number}","issue_comment_url":"https://api.github.com/repos/sass/linter/issues/comments{/number}","contents_url":"https://api.github.com/repos/sass/linter/contents/{+path}","compare_url":"https://api.github.com/repos/sass/linter/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sass/linter/merges","archive_url":"https://api.github.com/repos/sass/linter/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sass/linter/downloads","issues_url":"https://api.github.com/repos/sass/linter/issues{/number}","pulls_url":"https://api.github.com/repos/sass/linter/pulls{/number}","milestones_url":"https://api.github.com/repos/sass/linter/milestones{/number}","notifications_url":"https://api.github.com/repos/sass/linter/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sass/linter/labels{/name}","releases_url":"https://api.github.com/repos/sass/linter/releases{/id}","deployments_url":"https://api.github.com/repos/sass/linter/deployments","created_at":"2018-06-01T23:19:21Z","updated_at":"2018-11-20T21:27:56Z","pushed_at":"2018-12-11T23:15:33Z","git_url":"git://github.com/sass/linter.git","ssh_url":"git@github.com:sass/linter.git","clone_url":"https://github.com/sass/linter.git","svn_url":"https://github.com/sass/linter","homepage":null,"size":48,"stargazers_count":33,"watchers_count":33,"language":"Dart","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"archived":false,"open_issues_count":12,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":4,"open_issues":12,"watchers":33,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sass/linter/pulls/34"},"html":{"href":"https://github.com/sass/linter/pull/34"},"issue":{"href":"https://api.github.com/repos/sass/linter/issues/34"},"comments":{"href":"https://api.github.com/repos/sass/linter/issues/34/comments"},"review_comments":{"href":"https://api.github.com/repos/sass/linter/pulls/34/comments"},"review_comment":{"href":"https://api.github.com/repos/sass/linter/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sass/linter/pulls/34/commits"},"statuses":{"href":"https://api.github.com/repos/sass/linter/statuses/9b2adbf899bbcf260d73fa7a77243c8b42ec97b1"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"nex3"}}