Skip to content
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

pronto doesn't analyse staged changes #111

Closed
konradstrack opened this issue Nov 18, 2015 · 7 comments
Closed

pronto doesn't analyse staged changes #111

konradstrack opened this issue Nov 18, 2015 · 7 comments

Comments

@konradstrack
Copy link

I've been trying to execute pronto in a pre-commit hook, and I ended up with the following issue.

Suppose I have a file with inorrect indentation: in this case it's Gemfile. I stage it with git add Gemfile and execute pronto run --index. No issues are reported.

Now, if I do git reset Gemfile, pronto run --index will report the issues correctly, e.g.:

Gemfile:166 I: Inconsistent indentation detected.
Gemfile:167 I: Tab detected.
Gemfile:167 I: Inconsistent indentation detected.
Gemfile:168 I: Tab detected.
Gemfile:168 I: Inconsistent indentation detected.

I tested a bit more, and staged changes are not being analysed with all of the following:
pronto run,
pronto run --index,
pronto run --commit=$(git log --pretty=format:%H | head -1),
pronto run --commit=HEAD.

Is there something trivial I have missed, or is this behaviour expected?

I used Ruby 2.1.5. More info:

    pronto (0.5.3)
      gitlab (~> 3.4.0)
      octokit (~> 4.1.0)
      rugged (~> 0.23.0)
      thor (~> 0.19.0)
    pronto-flay (0.5.0)
      flay (~> 2.6.0)
      pronto (~> 0.5.0)
    pronto-jshint (0.5.0)
      jshintrb (~> 0.3.0)
      pronto (~> 0.5.0)
    pronto-rails_best_practices (0.5.0)
      pronto (~> 0.5.0)
      rails_best_practices (~> 1.15.0)
    pronto-rails_schema (0.5.0)
      pronto (~> 0.5.0)
    pronto-rubocop (0.5.0)
      pronto (~> 0.5.0)
      rubocop (~> 0.35.0)
@mmozuras
Copy link
Member

@konradstrack I've created an issue on rugged repo.

@mmozuras mmozuras added the bug label Nov 18, 2015
@mmozuras
Copy link
Member

Changing this from bug to enhancement. You can follow the discussion here:

libgit2/rugged#548

Will make it part of the next release, because an integration with overcommit would be great.

@mmozuras mmozuras added enhancement and removed bug labels Nov 18, 2015
@elliotthilaire
Copy link

I've also come across this issue.
Is this something I can help with?

@KirillSuhodolov
Copy link

KirillSuhodolov commented Sep 14, 2016

  • will be great have integration with overcommit

@MvanDiemen
Copy link

@mmozuras any update on how to use this with staged changes?

@mmozuras
Copy link
Member

mmozuras commented Mar 3, 2017

@konradstrack @elliotthilaire @KirillSuhodolov @MvanDiemen I've renamed the --index option to --unstaged and added --staged options as requested with this commit. You can test it by building master and installing master locally. Would love feedback 😄

@mmozuras
Copy link
Member

mmozuras commented Apr 23, 2017

@KirillSuhodolov @glennr you can find the PR on Overcommit for a pre-commit hook here: sds/overcommit#488 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants