{"id":18253556,"url":"https://github.com/krk/sa1413","last_synced_at":"2025-08-08T08:39:43.526Z","repository":{"id":144198623,"uuid":"120015160","full_name":"krk/SA1413","owner":"krk","description":"Use Trailing Commas In MultiLine Initializers Analyzer","archived":false,"fork":false,"pushed_at":"2018-04-24T12:26:46.000Z","size":42,"stargazers_count":0,"open_issues_count":1,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-08-01T08:49:14.526Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/krk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-02-02T18:15:09.000Z","updated_at":"2018-04-24T12:26:48.000Z","dependencies_parsed_at":"2023-06-16T10:45:38.918Z","dependency_job_id":null,"html_url":"https://github.com/krk/SA1413","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/krk/SA1413","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krk%2FSA1413","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krk%2FSA1413/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krk%2FSA1413/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krk%2FSA1413/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/krk","download_url":"https://codeload.github.com/krk/SA1413/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krk%2FSA1413/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269391914,"owners_count":24409720,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-08T02:00:09.200Z","response_time":72,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-05T10:07:12.390Z","updated_at":"2025-08-08T08:39:43.514Z","avatar_url":"https://github.com/krk.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"SA1413 https://github.com/DotNetAnalyzers/StyleCopAnalyzers rule as a stand-alone Roslyn Analyzer.\n\n[![Build status](https://ci.appveyor.com/api/projects/status/qoqatl4nj8ekq61u?svg=true)](https://ci.appveyor.com/project/krk/sa1413)\n[![NuGet](https://img.shields.io/nuget/v/RoslynAnalyzers.SA1413.svg?style=plastic)](https://www.nuget.org/packages/RoslynAnalyzers.SA1413/)\n\n# SA1413\n\n\u003ctable\u003e\n\u003ctr\u003e\n  \u003ctd\u003eTypeName\u003c/td\u003e\n  \u003ctd\u003eSA1413UseTrailingCommasInMultiLineInitializers\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n  \u003ctd\u003eCheckId\u003c/td\u003e\n  \u003ctd\u003eSA1413\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n  \u003ctd\u003eCategory\u003c/td\u003e\n  \u003ctd\u003eMaintainability Rules\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/table\u003e\n\n:memo: This rule is new for StyleCop Analyzers, and was not present in StyleCop Classic.\n\n## Cause\n\nThe last statement in a multi-line C# initializer or list is missing a trailing comma.\n\n### Rationale\n\nThis rule is specifically designed to work well with the most widely used source control systems as an aid to long-term\ncode review. By placing a comma on the last line of a multi-line sequence, developers who append an item to the list or\nreorder the list at some point in the future will not need to modify any more lines than absolutely necessary for the\nchange. As a result, the size of the subsequent code review is minimized and focused, and tools like **git blame**\ncontinue to show the original author and commit for the item that was previously last in the list.\n\n## Rule description\n\nA violation of this rule occurs when the last statement of a C# initializer or list is missing a trailing comma.\n\nFor example, the following code would generate one instance of this violation:\n\n```csharp\nvar x = new Barnacle\n{\n    Age = 100,\n    Height = 0.2M,\n    Weight = 0.88M\n};\n```\n\nThe following code would not produce any violations:\n\n```csharp\nvar x = new Barnacle\n{\n    Age = 100,\n    Height = 0.2M,\n    Weight = 0.88M,\n};\n```\n\nThis diagnostic is also reported for other forms of comma-separated list, such as enum members.\n\n## How to fix violations\n\nTo fix a violation of this rule, add a trailing comma to the last statement in the initializer.\n\n## How to suppress violations\n\n```csharp\n[SuppressMessage(\"StyleCop.CSharp.MaintainabilityRules\", \"SA1413:UseTrailingCommasInMultiLineInitializers\", Justification = \"Reviewed.\")]\n```\n\n```csharp\n#pragma warning disable SA1413 // UseTrailingCommasInMultiLineInitializers\n#pragma warning restore SA1413 // UseTrailingCommasInMultiLineInitializers\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkrk%2Fsa1413","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkrk%2Fsa1413","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkrk%2Fsa1413/lists"}