{"id":15042480,"url":"https://github.com/arturwincenciak/resharper_cleanupcode","last_synced_at":"2026-02-27T08:05:50.141Z","repository":{"id":85783165,"uuid":"584954820","full_name":"ArturWincenciak/ReSharper_CleanupCode","owner":"ArturWincenciak","description":"Clean up your code with GitHub Action. Save your time from having to do a code review and make corrections and also from having to enter a commit message each time. The commit with the changes is created automatically.","archived":false,"fork":false,"pushed_at":"2024-04-02T15:54:02.000Z","size":21,"stargazers_count":10,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-12T08:41:11.801Z","etag":null,"topics":["bash","bash-script","cleanup","cleanup-script","cleanups","csharp","dotnet","dotnet-core","github-actions","github-marketplace","jetbrains","jetbrains-command-line-tool","lint","linter","resharper","resharper-command-line-tool"],"latest_commit_sha":null,"homepage":"https://github.com/ArturWincenciak/ReSharper_CleanupCode_Demo","language":"Shell","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/ArturWincenciak.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":"2023-01-04T00:11:54.000Z","updated_at":"2025-02-14T14:49:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"298e5f17-960a-4408-9a5c-9b5fbef3d53b","html_url":"https://github.com/ArturWincenciak/ReSharper_CleanupCode","commit_stats":{"total_commits":25,"total_committers":2,"mean_commits":12.5,"dds":0.12,"last_synced_commit":"b3a4da3a34c4684b5438e19c4f634d5067b184ec"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArturWincenciak%2FReSharper_CleanupCode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArturWincenciak%2FReSharper_CleanupCode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArturWincenciak%2FReSharper_CleanupCode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArturWincenciak%2FReSharper_CleanupCode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ArturWincenciak","download_url":"https://codeload.github.com/ArturWincenciak/ReSharper_CleanupCode/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248956690,"owners_count":21189395,"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":["bash","bash-script","cleanup","cleanup-script","cleanups","csharp","dotnet","dotnet-core","github-actions","github-marketplace","jetbrains","jetbrains-command-line-tool","lint","linter","resharper","resharper-command-line-tool"],"created_at":"2024-09-24T20:47:22.431Z","updated_at":"2026-02-27T08:05:50.089Z","avatar_url":"https://github.com/ArturWincenciak.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ReSharper CLI CleanupCode\n\n\u003e ### Visit the blog post to read more about the context of use cases\n\u003e [Zaoszczędź swój czas, niech kod wyczyści się sam – ReSharper CLI CleanupCode GitHub Action](https://teo-vincent.blog/2023/12/31/zaoszczedz-swoj-czas-niech-kod-wyczysci-sie-sam-resharper-cli-cleanupcode-github-action/)\n\nGitHub Action automatically cleans up your code and creates a commit with the changes in your remote repository.\n\nSave your time from having to do a code review and make corrections and also from having to enter a commit message each time. \nThe commit with the changes is created automatically.\n\n## Automatically clean up your code\n\nThat is a GitHub Action that allows you to run \n[ReSharper's CleanupCode Command-Line Tool](https://www.jetbrains.com/help/resharper/CleanupCode.html) \nin order to automatically apply code style rules and fix code issues in your project.\n\n[CleanupCode will read the following preferences from DotSettings files](https://www.jetbrains.com/help/resharper/CleanupCode.html#configuring-cleanupcode-with-dotsettings):\n- [Code formatting rules](https://www.jetbrains.com/help/resharper/Configure_Code_Formatting_Rules.html)\n- [Syntax styles](https://www.jetbrains.com/help/resharper/Code_Syntax_Style.html)\n- [File header style in C# and C++](https://www.jetbrains.com/help/resharper/File_Header_Style.html)\n- [File and type layout in C#](https://www.jetbrains.com/help/resharper/File_and_Type_Layout.html)\n\n## Inputs\n\nThe following input parameters can be passed to the action:\n\n## `solution`\n\nSolution or project file to be cleaned up.\n\n- **Required: `true`**\n\n## `fail_on_reformat_needed`\n\nDetermines whether the action should fail if the code needs to be reformatted.\n\n- Required: `false`\n- Default: `no`\n- Accepted values: `yes`, `no`\n\n## `jb_cleanup_code_arg`\n\nAdditional arguments to pass to the `ReSharper's CleanupCode Command-Line Tool`. Configure the tool with command-line parameters, \ne.g.: `--verbosity=INFO --profile=Built-in: Full Cleanup --exclude=**UnitTests/**.*`.\n\n- [See more here in that clear and concise specification](https://www.jetbrains.com/help/resharper/CleanupCode.html#command-line-parameters)\n- **Notice**: Never use quotation marks `\"` even if the value contains spaces. The command separator is `--` (two hyphens in a row) and this\n  is enough to split arguments. If you use quotation marks, the behavior is undefined.\n- Required: `false`\n- Default: `--verbosity=WARN`\n\n# [ReSharper CLI CleanupCode GitHub Action Demo Usage](https://github.com/ArturWincenciak/ReSharper_CleanupCode_Demo)\n\nIn that demo project, you will find all the knowledge you need to effectively start using this action.\n\n## Try your self demo project\n1. Go to the [demo project](https://github.com/ArturWincenciak/ReSharper_CleanupCode_Demo)\n2. Fork this repo \n3. Create a Pull Request \n4. Go to `Actions` and observe the action in action \n5. Check out history of your repo and see newly created commit\n   \n## The simplest way to usage\n\n```yaml\nsteps:\n  - name: Cleanup Code\n    uses: ArturWincenciak/ReSharper_CleanupCode@v2.0\n    with:\n      solution: 'ReSharperCleanupCodeDemo.sln'\n```\n\n## Interrupt your CI/CD pipeline if Cleanup detected the code needs to be cleaned up\n\n```yaml\nsteps:\n  - name: Cleanup Code\n    uses: ArturWincenciak/ReSharper_CleanupCode@v2.0\n    with:\n      solution: 'ReSharperCleanupCodeDemo.sln'\n      fail_on_reformat_needed: 'yes'\n```\n\nIf this setting is enabled, the process will stop and return an error code if it finds that the code needs to be cleaned\nup. This can be helpful for stopping the pipeline from continuing if there are problems with the code.\n\n## No interrupt your CI/CD pipeline if Cleanup detected the code needs to be cleaned up\n\n```yaml\nsteps:\n  - name: Cleanup Code\n    uses: ArturWincenciak/ReSharper_CleanupCode@v2.0\n    with:\n      solution: 'ReSharperCleanupCodeDemo.sln'\n      fail_on_reformat_needed: 'no'\n```\n\n\nAt times, you may want to disable the interruption and continue with the execution of your CI/CD pipeline, for instance, when you need to debug subsequent steps without performing clean up.\n\n### Perform clean up your code locally with a fully automated commit and save your time\n\nFor such a case, I have prepared a ready-made script that you can run locally. This script will perform clean up code\nand create a commit with the changes in your local repository. This will save your time from having to\nenter a commit message each time. The commit with the changes will be created automatically.\n\n- [local-dev-cleanup-code.sh](https://github.com/ArturWincenciak/ReSharper_CleanupCode_Demo/blob/main/local-dev-cleanup-code.sh)\n- [How to use the clean up your code bash script in local repo](https://github.com/ArturWincenciak/ReSharper_CleanupCode_Demo#clean-up-your-code-in-local-repo)\n\n\u003e _This script can be attached to the git hooks, however, attaching this script to the `pre-commit` git hook is\nnot advisable as it may slow down our work considerably due to the lengthy clean up code process. It may be more\nbeneficial to add this script to the `pre-push` git hook instead._\n\n## Fully configured and ready to use\n\n```yaml\nname: ReSharper CLI CleanupCode\n\non: [ push ]\n\njobs:\n  cleanup:\n    runs-on: ubuntu-latest\n    name: Cleanup Code\n    \n    steps:\n      - name: Checkout\n        uses: actions/checkout@v3\n\n      - name: Setup .NET\n        uses: actions/setup-dotnet@v3\n        with:\n          dotnet-version: 7.0.x\n\n      - name: Restore Dependencies\n        run: dotnet restore ReSharperCleanupCodeDemo.sln\n          \n      - name: Cleanup Code\n        id: cleanup\n        uses: ArturWincenciak/ReSharper_CleanupCode@v4.14\n        with:\n          solution: 'ReSharperCleanupCodeDemo.sln'\n          fail_on_reformat_needed: 'no'\n          jb_cleanup_code_arg: '--verbosity=INFO --profile=Built-in: Full Cleanup --exclude=**UnitTests/**.*'\n```\n### Sequence of actions performed by the prepared GitHub Action\n- `Checkout`: download the source code from the current repository where the Action was\ninitiated\n- `Setup .NET`: install the specified version of .NET on the virtual machine where the Action is run \n- `Restore Dependencies`: restore all project dependencies, such as NuGet libraries\n- `Cleanup Code` clean up the code\n\n# Cleanup Code works perfectly with Inspect Code\n\nThere are situations where Cleanup Code does not do the entire job for us, but we can still greatly help ourselves and\nspeed up ours Code Review process by adding an additional automatic step that performs an inspection of the code and, \nadds a comments to the submitted Pull Request on our behalf.\n\nHere in that demo project \n[ReSharper CLI CleanupCode GitHub Action Demo](https://github.com/ArturWincenciak/ReSharper_CleanupCode_Demo#cleanup-code-works-perfectly-with-inspect-code), \nI show you how to combine [ReSharper CLI CleanupCode](https://github.com/marketplace/actions/resharper-cli-cleanupcode)\nand [ReSharper CLI InspectCode](https://github.com/marketplace/actions/resharper-cli-inspectcode) \nusing [GitHub Action Definition](https://github.com/ArturWincenciak/ReSharper_CleanupCode_Demo/blob/main/.github/workflows/cleanup_code.yml)\nthat contains two jobs: `cleanup` and `inspection`.\n\nRefer to \n[the demo project](https://github.com/ArturWincenciak/ReSharper_CleanupCode_Demo#cleanup-code-works-perfectly-with-inspect-code)\nand gain all the knowledge on how to speed up your daily development process.\n\n```yaml\nname: ReSharper CLI CleanupCode\n\non: [ push ]\n\njobs:\n  cleanup:\n    runs-on: ubuntu-latest\n    name: Cleanup Code\n    \n    steps:\n      - name: Checkout\n        uses: actions/checkout@v3\n\n      - name: Setup .NET\n        uses: actions/setup-dotnet@v3\n        with:\n          dotnet-version: 7.0.x\n\n      - name: Restore Dependencies\n        run: dotnet restore ReSharperCleanupCodeDemo.sln\n          \n      - name: Cleanup Code\n        id: cleanup\n        uses: ArturWincenciak/ReSharper_CleanupCode@v3.0\n        with:\n          solution: 'ReSharperCleanupCodeDemo.sln'\n          fail_on_reformat_needed: 'no'\n          jb_cleanup_code_arg: '--verbosity=INFO --profile=Almost Full Cleanup --exclude=**UnitTests/**.*'\n  \n  inspection:\n    runs-on: ubuntu-latest\n    name: Inspect Code\n    needs: cleanup\n\n    steps:\n      - name: Checkout\n        uses: actions/checkout@v3\n\n      - name: Setup .NET\n        uses: actions/setup-dotnet@v3\n        with:\n          dotnet-version: 7.0.x\n\n      - name: Restore Dependencies\n        run: dotnet restore ReSharperCleanupCodeDemo.sln\n\n      - name: Inspect code\n        uses: muno92/resharper_inspectcode@1.6.5\n        with:\n          solutionPath: ./ReSharperCleanupCodeDemo.sln\n          failOnIssue: 1\n          minimumSeverity: notice\n          solutionWideAnalysis: true\n```\n\n\u003e _[ReSharper CLI InspectCode](https://github.com/marketplace/actions/resharper-cli-inspectcode) - that one I've found \n\u003e in the Marketplace and used in the \n\u003e [demo project](https://github.com/ArturWincenciak/ReSharper_CleanupCode_Demo#cleanup-code-works-perfectly-with-inspect-code), \n\u003e it was an **inspiration** for me to create my own `ReSharper CLI CleanupCode` the second tool in this toolkit. These two\ntools complement each other well and produce nice results._\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farturwincenciak%2Fresharper_cleanupcode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farturwincenciak%2Fresharper_cleanupcode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farturwincenciak%2Fresharper_cleanupcode/lists"}