{"action":"created","comment":{"url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/pulls/comments/36576009","id":36576009,"diff_hunk":"@@ -0,0 +1,66 @@\n+﻿namespace StyleCop.Analyzers.MaintainabilityRules\n+{\n+    using System.Collections.Immutable;\n+    using System.Composition;\n+    using System.Text;\n+    using System.Threading.Tasks;\n+    using Helpers;\n+    using Microsoft.CodeAnalysis;\n+    using Microsoft.CodeAnalysis.CodeActions;\n+    using Microsoft.CodeAnalysis.CodeFixes;\n+    using Microsoft.CodeAnalysis.Text;\n+\n+    /// <summary>\n+    /// Implements a code fix for <see cref=\"SA1412StoreFilesAsUtf8\"/>.\n+    /// </summary>\n+    /// <remarks>\n+    /// <para>To fix a violation of this rule, change the encoding to utf-8 with preamble.</para>\n+    /// </remarks>\n+    [ExportCodeFixProvider(LanguageNames.CSharp, Name = nameof(SA1412CodeFixProvider))]\n+    [Shared]\n+    public class SA1412CodeFixProvider : CodeFixProvider\n+    {\n+        private static readonly ImmutableArray<string> FixableDiagnostics =\n+            ImmutableArray.Create(SA1412StoreFilesAsUtf8.DiagnosticId);\n+\n+        /// <inheritdoc/>\n+        public override ImmutableArray<string> FixableDiagnosticIds => FixableDiagnostics;\n+\n+        /// <inheritdoc/>\n+        public override FixAllProvider GetFixAllProvider()\n+        {\n+            return CustomFixAllProviders.BatchFixer;\n+        }\n+\n+        /// <inheritdoc/>\n+        public override async Task RegisterCodeFixesAsync(CodeFixContext context)\n+        {\n+            var root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);\n+\n+            foreach (var diagnostic in context.Diagnostics)\n+            {\n+                if (!this.FixableDiagnosticIds.Contains(diagnostic.Id))\n+                {\n+                    continue;\n+                }\n+\n+                context.RegisterCodeFix(CodeAction.Create(\"Fix encoding\", token => GetTransformedSolutionAsync(context.Document), equivalenceKey: nameof(SA1412CodeFixProvider)), diagnostic);","path":"StyleCop.Analyzers/StyleCop.Analyzers/MaintainabilityRules/SA1412CodeFixProvider.cs","position":47,"original_position":47,"commit_id":"85c8e5ce0a5702e2d7c0995b71be0fcdbcd4f78a","original_commit_id":"85c8e5ce0a5702e2d7c0995b71be0fcdbcd4f78a","user":{"login":"Maxwe11","id":1083827,"avatar_url":"https://avatars.githubusercontent.com/u/1083827?v=3","gravatar_id":"","url":"https://api.github.com/users/Maxwe11","html_url":"https://github.com/Maxwe11","followers_url":"https://api.github.com/users/Maxwe11/followers","following_url":"https://api.github.com/users/Maxwe11/following{/other_user}","gists_url":"https://api.github.com/users/Maxwe11/gists{/gist_id}","starred_url":"https://api.github.com/users/Maxwe11/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Maxwe11/subscriptions","organizations_url":"https://api.github.com/users/Maxwe11/orgs","repos_url":"https://api.github.com/users/Maxwe11/repos","events_url":"https://api.github.com/users/Maxwe11/events{/privacy}","received_events_url":"https://api.github.com/users/Maxwe11/received_events","type":"User","site_admin":false},"body":"nit: to very long line which doesn't fit on my laptop's screen","created_at":"2015-08-08T07:36:15Z","updated_at":"2015-08-08T07:36:15Z","html_url":"https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/1151#discussion_r36576009","pull_request_url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/pulls/1151","_links":{"self":{"href":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/pulls/comments/36576009"},"html":{"href":"https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/1151#discussion_r36576009"},"pull_request":{"href":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/pulls/1151"}}},"pull_request":{"url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/pulls/1151","id":41946138,"html_url":"https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/1151","diff_url":"https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/1151.diff","patch_url":"https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/1151.patch","issue_url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/issues/1151","number":1151,"state":"open","locked":false,"title":"Implement SA1412 store files as utf8","user":{"login":"pdelvo","id":1710209,"avatar_url":"https://avatars.githubusercontent.com/u/1710209?v=3","gravatar_id":"","url":"https://api.github.com/users/pdelvo","html_url":"https://github.com/pdelvo","followers_url":"https://api.github.com/users/pdelvo/followers","following_url":"https://api.github.com/users/pdelvo/following{/other_user}","gists_url":"https://api.github.com/users/pdelvo/gists{/gist_id}","starred_url":"https://api.github.com/users/pdelvo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pdelvo/subscriptions","organizations_url":"https://api.github.com/users/pdelvo/orgs","repos_url":"https://api.github.com/users/pdelvo/repos","events_url":"https://api.github.com/users/pdelvo/events{/privacy}","received_events_url":"https://api.github.com/users/pdelvo/received_events","type":"User","site_admin":false},"body":"Implements the diagnostic, the code fix and tests for #1142.\r\n\r\nThis is blocked on whether or not we decide to use this rule.","created_at":"2015-08-08T01:33:41Z","updated_at":"2015-08-08T07:36:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0c59912e624ae04a9d1f4194b1257b9655eaf5a9","assignee":{"login":"sharwell","id":1408396,"avatar_url":"https://avatars.githubusercontent.com/u/1408396?v=3","gravatar_id":"","url":"https://api.github.com/users/sharwell","html_url":"https://github.com/sharwell","followers_url":"https://api.github.com/users/sharwell/followers","following_url":"https://api.github.com/users/sharwell/following{/other_user}","gists_url":"https://api.github.com/users/sharwell/gists{/gist_id}","starred_url":"https://api.github.com/users/sharwell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sharwell/subscriptions","organizations_url":"https://api.github.com/users/sharwell/orgs","repos_url":"https://api.github.com/users/sharwell/repos","events_url":"https://api.github.com/users/sharwell/events{/privacy}","received_events_url":"https://api.github.com/users/sharwell/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/milestones/17","html_url":"https://github.com/DotNetAnalyzers/StyleCopAnalyzers/milestones/1.0.0%20Beta%205","labels_url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/milestones/17/labels","id":1244896,"number":17,"title":"1.0.0 Beta 5","description":"","creator":{"login":"sharwell","id":1408396,"avatar_url":"https://avatars.githubusercontent.com/u/1408396?v=3","gravatar_id":"","url":"https://api.github.com/users/sharwell","html_url":"https://github.com/sharwell","followers_url":"https://api.github.com/users/sharwell/followers","following_url":"https://api.github.com/users/sharwell/following{/other_user}","gists_url":"https://api.github.com/users/sharwell/gists{/gist_id}","starred_url":"https://api.github.com/users/sharwell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sharwell/subscriptions","organizations_url":"https://api.github.com/users/sharwell/orgs","repos_url":"https://api.github.com/users/sharwell/repos","events_url":"https://api.github.com/users/sharwell/events{/privacy}","received_events_url":"https://api.github.com/users/sharwell/received_events","type":"User","site_admin":false},"open_issues":3,"closed_issues":9,"state":"open","created_at":"2015-08-07T03:33:17Z","updated_at":"2015-08-08T05:33:42Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/pulls/1151/commits","review_comments_url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/pulls/1151/comments","review_comment_url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/pulls/comments{/number}","comments_url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/issues/1151/comments","statuses_url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/statuses/85c8e5ce0a5702e2d7c0995b71be0fcdbcd4f78a","head":{"label":"pdelvo:fix-1142","ref":"fix-1142","sha":"85c8e5ce0a5702e2d7c0995b71be0fcdbcd4f78a","user":{"login":"pdelvo","id":1710209,"avatar_url":"https://avatars.githubusercontent.com/u/1710209?v=3","gravatar_id":"","url":"https://api.github.com/users/pdelvo","html_url":"https://github.com/pdelvo","followers_url":"https://api.github.com/users/pdelvo/followers","following_url":"https://api.github.com/users/pdelvo/following{/other_user}","gists_url":"https://api.github.com/users/pdelvo/gists{/gist_id}","starred_url":"https://api.github.com/users/pdelvo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pdelvo/subscriptions","organizations_url":"https://api.github.com/users/pdelvo/orgs","repos_url":"https://api.github.com/users/pdelvo/repos","events_url":"https://api.github.com/users/pdelvo/events{/privacy}","received_events_url":"https://api.github.com/users/pdelvo/received_events","type":"User","site_admin":false},"repo":{"id":28428027,"name":"StyleCopAnalyzers","full_name":"pdelvo/StyleCopAnalyzers","owner":{"login":"pdelvo","id":1710209,"avatar_url":"https://avatars.githubusercontent.com/u/1710209?v=3","gravatar_id":"","url":"https://api.github.com/users/pdelvo","html_url":"https://github.com/pdelvo","followers_url":"https://api.github.com/users/pdelvo/followers","following_url":"https://api.github.com/users/pdelvo/following{/other_user}","gists_url":"https://api.github.com/users/pdelvo/gists{/gist_id}","starred_url":"https://api.github.com/users/pdelvo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pdelvo/subscriptions","organizations_url":"https://api.github.com/users/pdelvo/orgs","repos_url":"https://api.github.com/users/pdelvo/repos","events_url":"https://api.github.com/users/pdelvo/events{/privacy}","received_events_url":"https://api.github.com/users/pdelvo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pdelvo/StyleCopAnalyzers","description":"An implementation of StyleCop rules using the .NET Compiler Platform","fork":true,"url":"https://api.github.com/repos/pdelvo/StyleCopAnalyzers","forks_url":"https://api.github.com/repos/pdelvo/StyleCopAnalyzers/forks","keys_url":"https://api.github.com/repos/pdelvo/StyleCopAnalyzers/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pdelvo/StyleCopAnalyzers/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pdelvo/StyleCopAnalyzers/teams","hooks_url":"https://api.github.com/repos/pdelvo/StyleCopAnalyzers/hooks","issue_events_url":"https://api.github.com/repos/pdelvo/StyleCopAnalyzers/issues/events{/number}","events_url":"https://api.github.com/repos/pdelvo/StyleCopAnalyzers/events","assignees_url":"https://api.github.com/repos/pdelvo/StyleCopAnalyzers/assignees{/user}","branches_url":"https://api.github.com/repos/pdelvo/StyleCopAnalyzers/branches{/branch}","tags_url":"https://api.github.com/repos/pdelvo/StyleCopAnalyzers/tags","blobs_url":"https://api.github.com/repos/pdelvo/StyleCopAnalyzers/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pdelvo/StyleCopAnalyzers/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pdelvo/StyleCopAnalyzers/git/refs{/sha}","trees_url":"https://api.github.com/repos/pdelvo/StyleCopAnalyzers/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pdelvo/StyleCopAnalyzers/statuses/{sha}","languages_url":"https://api.github.com/repos/pdelvo/StyleCopAnalyzers/languages","stargazers_url":"https://api.github.com/repos/pdelvo/StyleCopAnalyzers/stargazers","contributors_url":"https://api.github.com/repos/pdelvo/StyleCopAnalyzers/contributors","subscribers_url":"https://api.github.com/repos/pdelvo/StyleCopAnalyzers/subscribers","subscription_url":"https://api.github.com/repos/pdelvo/StyleCopAnalyzers/subscription","commits_url":"https://api.github.com/repos/pdelvo/StyleCopAnalyzers/commits{/sha}","git_commits_url":"https://api.github.com/repos/pdelvo/StyleCopAnalyzers/git/commits{/sha}","comments_url":"https://api.github.com/repos/pdelvo/StyleCopAnalyzers/comments{/number}","issue_comment_url":"https://api.github.com/repos/pdelvo/StyleCopAnalyzers/issues/comments{/number}","contents_url":"https://api.github.com/repos/pdelvo/StyleCopAnalyzers/contents/{+path}","compare_url":"https://api.github.com/repos/pdelvo/StyleCopAnalyzers/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pdelvo/StyleCopAnalyzers/merges","archive_url":"https://api.github.com/repos/pdelvo/StyleCopAnalyzers/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pdelvo/StyleCopAnalyzers/downloads","issues_url":"https://api.github.com/repos/pdelvo/StyleCopAnalyzers/issues{/number}","pulls_url":"https://api.github.com/repos/pdelvo/StyleCopAnalyzers/pulls{/number}","milestones_url":"https://api.github.com/repos/pdelvo/StyleCopAnalyzers/milestones{/number}","notifications_url":"https://api.github.com/repos/pdelvo/StyleCopAnalyzers/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pdelvo/StyleCopAnalyzers/labels{/name}","releases_url":"https://api.github.com/repos/pdelvo/StyleCopAnalyzers/releases{/id}","created_at":"2014-12-24T01:24:25Z","updated_at":"2015-05-03T00:58:04Z","pushed_at":"2015-08-08T01:32:06Z","git_url":"git://github.com/pdelvo/StyleCopAnalyzers.git","ssh_url":"git@github.com:pdelvo/StyleCopAnalyzers.git","clone_url":"https://github.com/pdelvo/StyleCopAnalyzers.git","svn_url":"https://github.com/pdelvo/StyleCopAnalyzers","homepage":null,"size":5729,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"DotNetAnalyzers:master","ref":"master","sha":"cedc7e8132e301c2e96aa5c9b6c1988f0ab7f8c5","user":{"login":"DotNetAnalyzers","id":9735576,"avatar_url":"https://avatars.githubusercontent.com/u/9735576?v=3","gravatar_id":"","url":"https://api.github.com/users/DotNetAnalyzers","html_url":"https://github.com/DotNetAnalyzers","followers_url":"https://api.github.com/users/DotNetAnalyzers/followers","following_url":"https://api.github.com/users/DotNetAnalyzers/following{/other_user}","gists_url":"https://api.github.com/users/DotNetAnalyzers/gists{/gist_id}","starred_url":"https://api.github.com/users/DotNetAnalyzers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DotNetAnalyzers/subscriptions","organizations_url":"https://api.github.com/users/DotNetAnalyzers/orgs","repos_url":"https://api.github.com/users/DotNetAnalyzers/repos","events_url":"https://api.github.com/users/DotNetAnalyzers/events{/privacy}","received_events_url":"https://api.github.com/users/DotNetAnalyzers/received_events","type":"Organization","site_admin":false},"repo":{"id":26768275,"name":"StyleCopAnalyzers","full_name":"DotNetAnalyzers/StyleCopAnalyzers","owner":{"login":"DotNetAnalyzers","id":9735576,"avatar_url":"https://avatars.githubusercontent.com/u/9735576?v=3","gravatar_id":"","url":"https://api.github.com/users/DotNetAnalyzers","html_url":"https://github.com/DotNetAnalyzers","followers_url":"https://api.github.com/users/DotNetAnalyzers/followers","following_url":"https://api.github.com/users/DotNetAnalyzers/following{/other_user}","gists_url":"https://api.github.com/users/DotNetAnalyzers/gists{/gist_id}","starred_url":"https://api.github.com/users/DotNetAnalyzers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DotNetAnalyzers/subscriptions","organizations_url":"https://api.github.com/users/DotNetAnalyzers/orgs","repos_url":"https://api.github.com/users/DotNetAnalyzers/repos","events_url":"https://api.github.com/users/DotNetAnalyzers/events{/privacy}","received_events_url":"https://api.github.com/users/DotNetAnalyzers/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/DotNetAnalyzers/StyleCopAnalyzers","description":"An implementation of StyleCop rules using the .NET Compiler Platform","fork":false,"url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers","forks_url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/forks","keys_url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/teams","hooks_url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/hooks","issue_events_url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/issues/events{/number}","events_url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/events","assignees_url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/assignees{/user}","branches_url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/branches{/branch}","tags_url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/tags","blobs_url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/git/refs{/sha}","trees_url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/statuses/{sha}","languages_url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/languages","stargazers_url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/stargazers","contributors_url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/contributors","subscribers_url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/subscribers","subscription_url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/subscription","commits_url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/commits{/sha}","git_commits_url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/git/commits{/sha}","comments_url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/comments{/number}","issue_comment_url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/issues/comments{/number}","contents_url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/contents/{+path}","compare_url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/merges","archive_url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/downloads","issues_url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/issues{/number}","pulls_url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/pulls{/number}","milestones_url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/milestones{/number}","notifications_url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/labels{/name}","releases_url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/releases{/id}","created_at":"2014-11-17T17:29:54Z","updated_at":"2015-08-06T12:45:38Z","pushed_at":"2015-08-08T05:33:43Z","git_url":"git://github.com/DotNetAnalyzers/StyleCopAnalyzers.git","ssh_url":"git@github.com:DotNetAnalyzers/StyleCopAnalyzers.git","clone_url":"https://github.com/DotNetAnalyzers/StyleCopAnalyzers.git","svn_url":"https://github.com/DotNetAnalyzers/StyleCopAnalyzers","homepage":null,"size":9997,"stargazers_count":138,"watchers_count":138,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":37,"mirror_url":null,"open_issues_count":159,"forks":37,"open_issues":159,"watchers":138,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/pulls/1151"},"html":{"href":"https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/1151"},"issue":{"href":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/issues/1151"},"comments":{"href":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/issues/1151/comments"},"review_comments":{"href":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/pulls/1151/comments"},"review_comment":{"href":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/pulls/1151/commits"},"statuses":{"href":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/statuses/85c8e5ce0a5702e2d7c0995b71be0fcdbcd4f78a"}}}}