Coder Social home page Coder Social logo

resharper-pre-commit-hook's Introduction

resharper-pre-commit-hook

Resharper format pre-commit hook. It uses resharper to format all the files you're committing, and automatically restages them.

Installation

Get the latest version using bash, by running this command in the root of your repository:

curl -s https://raw.githubusercontent.com/GeeWee/resharper-pre-commit-hook/master/install-git-hook.sh | bash

Note that this runs a shell script on your computer. You might want to review the script before running it.

License

MIT

resharper-pre-commit-hook's People

Contributors

geewee avatar jonroosevelt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

resharper-pre-commit-hook's Issues

Issues when folders have spaces in their names

Probably just needs some quotes around the git add:

Restaging files: BulkHarmonizer (copy)/BulkHarmonizer.csproj
BulkHarmonizer (copy)/FastlogHarmonizer.cs
BulkHarmonizer (copy)/HttpTester.cs
BulkHarmonizer (copy)/Indexer.cs
BulkHarmonizer (copy)/IngestPersist.cs
BulkHarmonizer (copy)/host.json
git add BulkHarmonizer (copy)/BulkHarmonizer.csproj BulkHarmonizer (copy)/FastlogHarmonizer.cs BulkHarmonizer (copy)/HttpTester.cs BulkHarmonizer (copy)/Indexer.cs BulkHarmonizer (copy)/IngestPersist.cs BulkHarmonizer (copy)/host.json 
fatal: pathspec '(copy)/BulkHarmonizer.csproj' did not match any files
"xargs -t -l git add" command filed with exit code 123.

cleanup.sh fails on commit

OS: Arch linux

Output of install-git-hook.sh

Cleaning up old versions
Extracting into ./.git/hooks/resharper
Adding pre-commit hook
Marking as executable
Cleaning up...

Output when commiting

Staged files .vscode/launch.json
.vscode/tasks.json
Purefolio-backend/DatabaseContext.cs
Purefolio-backend/Models/Models.cs
Purefolio-backend/Program.cs
Purefolio-backend/Startup.cs
Purefolio-backend/WeatherForecast.cs
Include string: .vscode/launch.json;.vscode/tasks.json;Purefolio-backend/DatabaseContext.cs;Purefolio-backend/Models/Models.cs;Purefolio-backend/Program.cs;Purefolio-backend/Startup.cs;Purefolio-backend/WeatherForecast.cs
Formatting files...
JetBrains Cleanup Code 2019.3.1
Running in 64-bit mode, .NET runtime 4.0.30319.42000 under Unix 5.8.7.1
Unable to find target solution file in path /home/archie/code/Purefolio-backend/OAI.sln
"sh ./.git/hooks/resharper/cleanupcode.sh --profile="Built-in: Reformat Code" ./OAI.sln --include="$INCLUDE_STRING"" command filed with exit code 1.

I was unable to locate what went wrong by looking at the source code. Do you have any suggestions?

Typo in the repo name

Should probably be resharper, not reshaper ... or was this intended for some copyright reasons or whatever?

Running the install script per the readme will not work

The readme states

curl -s https://raw.githubusercontent.com/GeeWee/reshaper-pre-commit-hook/master/install-git-hook.sh | sh (or bash, depending on your system)

If you can run your script with sh, you should. So you shouldn't advise people to run bash if they can run it with sh since it's more portable.

However, running this with sh doesn't work:

sh: 5: set: Illegal option -o pipefail

Running it with bash worked fine.

Ubuntu 18.04.

Add license

Could you specify which license this is released under? This hook looks great, but I can't include it in my project if the license isn't specified.

Not working on Mac OS Big Sur (11.1)

I am using oh-my-zsh, the following error showed up:

Formatting files...
JetBrains Cleanup Code 2019.3.1
Running in 64-bit mode, .NET runtime 4.0.30319.42000 under Unix 20.2.0.0
Usage: CleanupCode.exe [options] [project file]
Show help: CleanupCode.exe --help
"sh ./.git/hooks/resharper/cleanupcode.sh --profile="Built-in: Reformat Code" $SOLUTION_FILE --include="$INCLUDE_STRING"" command filed with exit code 1.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.