-
Notifications
You must be signed in to change notification settings - Fork 220
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add stage_fixed flag for hooks #109
Conversation
Could you explain about a little more? What problem does this PR solve? |
sorry, I haven't provided issue :) It's closes #64 |
Awesome! I will check it soon. |
// io.Copy(os.Stdout, ptyOut) // win specific | ||
if command.Wait() == nil { | ||
okList = append(okList, commandName) | ||
context.ExecGitCommand(fmt.Sprintf("git add %v", strings.Replace(string(fileNames), "\r\n", " ", -1))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like output logging is inconsistent with bash command.
Can you describe what is the difference between your approach and "git add {staged_files}", please? How do you achieve the passing of partially staged content to the linter-formatter, and how do you grab the result of it? I can explain some important cases for "stage_fixed" feature, as I understood it:
|
hey there, thanks for your review. There is no diff between this approach and |
@Arkweid any updates? |
Going to merge it at weekend. Sorry for so long! |
@rbUUbr Again sorry for so long. I have tested it on discourse example:
Could you recheck it? |
O_o will recheck it, thanks! |
Hi, sorry for long response time :( @Arkweid I can't reproduce it, but I found this issue creack/pty#21 pre-commit:
parallel: true
commands:
govet:
tags: backend style
run: go vet ./...
stage_fixed: true
golint:
tags: backend style
run: golint ./...
stage_fixed: true
gofmt:
tags: backend style
run: go fmt ./...
stage_fixed: true
terraformfmt:
tags: backend style
glob: '**/*.tf'
run: terraform fmt
stage_fixed: true
pre-push:
parallel: true
scripts:
"coverage.sh":
runner: bash |
I came across this PR because I was wondering how to include the results of automated documentation generation tools (like sphinx) and automated tests (like Coverage.py) in pre-commit:
commands:
format:
glob: "*.py"
run: black {staged_files}
test:
glob: "*.py"
run: pytest {files} && git add {files}
doc:
run: sphinx-build -a docs docs/_build/ && git add {files} A little messy looking with I would be very happy if you could tell me how you all do it so well. |
@Arkweid Is there any update on this? Would be good to get this merged in. Thanks! |
@mrexox Maybe you'll be able to help out? |
This feature is a good idea, but I see some nuances: Imagine we have staged a file partially: $ git status
AM file1
A file2
A file3 If we just
This feature is applicable only to |
Agreed, all makes sense to me. Yes this should only exist on @rbUUbr are you happy to work on this? If not I'm happy to pick up. |
Closing this in favor of #445. Please, feel free to open an issue if something doesn't work as expected. |
Hey, I like to do contributions in this repo, It helped me to practice a lot about Go with it. Thanks! So, I made this feature, it should work on Windows platform(I hope so, I don't have possibility to figure it out). Also, I've added
processError
function to output all errors and set pipe as broken but didn't make any refactoring, I hope it will be useful in the future.