{"id":23167992,"url":"https://github.com/mykolav/use-named-args-fs","last_synced_at":"2025-08-18T06:32:55.896Z","repository":{"id":143406849,"uuid":"140767813","full_name":"mykolav/use-named-args-fs","owner":"mykolav","description":"Suggest named arguments: a Roslyn code analyzer and code-fix provider for C#","archived":false,"fork":false,"pushed_at":"2024-01-23T20:01:25.000Z","size":4555,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-04-26T14:41:50.884Z","etag":null,"topics":["fsharp","named-arguments","roslyn","roslyn-analyzer"],"latest_commit_sha":null,"homepage":"","language":"F#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mykolav.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}},"created_at":"2018-07-12T21:47:15.000Z","updated_at":"2024-01-23T18:27:47.000Z","dependencies_parsed_at":"2023-06-25T19:38:21.015Z","dependency_job_id":null,"html_url":"https://github.com/mykolav/use-named-args-fs","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mykolav%2Fuse-named-args-fs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mykolav%2Fuse-named-args-fs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mykolav%2Fuse-named-args-fs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mykolav%2Fuse-named-args-fs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mykolav","download_url":"https://codeload.github.com/mykolav/use-named-args-fs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230209289,"owners_count":18190516,"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","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":["fsharp","named-arguments","roslyn","roslyn-analyzer"],"created_at":"2024-12-18T02:37:20.435Z","updated_at":"2024-12-18T02:37:30.576Z","avatar_url":"https://github.com/mykolav.png","language":"F#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Suggest method calls that can benefit from using named arguments\n\n[![Build status](https://ci.appveyor.com/api/projects/status/kr7293hw0oswn9fn?svg=true)](https://ci.appveyor.com/project/mykolav/use-named-args-fs)\n\nThis project contains a Roslyn code analyzer and an accompanying code-fix provider that suggest using named arguments when calling a method having successive parameters of the same type.\n\n![The UseNamedArgs analyzer in action](./use-named-args-demo.gif)\n\n## How to use it?\n\nJust install the [nuget package](https://www.nuget.org/packages/UseNamedArgs/). The analyzer is going to look for method invocations that can benefit from named arguments across the project.\n\n```csharp\npublic static void IntroduceCharacter(string name, string powerLevel) {}\n\n// Elsewhere in your code:\n// if `IntroduceCharacter` method is called with positional arguments,\n// the analyzer emits a warning, as the the method has two parameters \n// of the same type following one another.\nIntroduceCharacter(name: \"Goku\", powerLevel: \"Over 9000!\");\n```\n\n### Supported method kinds\n\nThe analyzer supports suggesting named arguments for the following method kinds  \n- Regular instance and static methods\n- Extension methods\n- Regular constructors\n- Attribute constructors\n- Primary constructors \n\n## Download and install\n\nInstall the [UseNamedArgs](https://www.nuget.org/packages/UseNamedArgs) nuget package.\nFor example, run the following command in the [NuGet Package Manager Console](https://docs.microsoft.com/en-us/nuget/tools/package-manager-console).\n\n```powershell\nInstall-Package UseNamedArgs\n```\n\nThis will download all the binaries, and add necessary analyzer references to your project.\n\n## Configuration\n\nStarting in Visual Studio 2019 version 16.3, you can [configure the severity of analyzer rules, or diagnostics](https://learn.microsoft.com/en-us/visualstudio/code-quality/use-roslyn-analyzers?view=vs-2022#configure-severity-levels), in an EditorConfig file, from the light bulb menu, and the error list.\n\nYou can add the following to the `[*.cs]` section of your .editorconfig.\n\n```ini\n[*.cs]\ndotnet_diagnostic.UseNamedArgs.severity = suggestion\n```\n\nThe possible severity values are:\n- `error`\n- `warning`\n- `suggestion`\n- `silent`\n- `none`\n- `default` (in case of this analyzer, it's equal to `warning`)\n\nPlease take a look at [the documentation](https://learn.microsoft.com/en-us/visualstudio/code-quality/use-roslyn-analyzers?view=vs-2022#configure-severity-levels) for a detailed description.\n\n\n# Thank you!\n\n- [John Koerner](https://github.com/johnkoerner) for [Creating a Code Analyzer using F#](https://johnkoerner.com/code-analysis/creating-a-code-analyzer-using-f/)\n- [Dustin Campbell](https://github.com/DustinCampbell) for [CSharpEssentials](https://github.com/DustinCampbell/CSharpEssentials)\n- [Alireza Habibi](https://github.com/alrz) for [CSharpUseNamedArgumentsCodeRefactoringProvider](https://github.com/dotnet/roslyn/blob/master/src/Features/CSharp/Portable/UseNamedArguments/CSharpUseNamedArgumentsCodeRefactoringProvider.cs) which provided very useful code examples.\n\n# License\n\nThe analyzer and code-fix provider are licensed under the MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmykolav%2Fuse-named-args-fs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmykolav%2Fuse-named-args-fs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmykolav%2Fuse-named-args-fs/lists"}