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

mix credo diff --from-git-ref master showing issues in files not modified #1028

Closed
dantuck opened this issue Feb 7, 2023 · 5 comments
Closed

Comments

@dantuck
Copy link

dantuck commented Feb 7, 2023

Environment

  • Credo version (mix credo -v): 1.6.7
  • Erlang/Elixir version (elixir -v):
Erlang/OTP 22 [erts-10.7.2.18] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1] [hipe]

Elixir 1.12.3 (compiled with Erlang/OTP 22)
  • Operating system: osx

What were you trying to do?

I have a repo that I only want to run checks on files changed. The checks should run from the default git repo (master in my case). No files have been changed yet issues are found in files that are not being modified.

I have done the following:

  • git fetch origin master:master and verified the commit is the latest on master
  • rebased working branch with master and ensured the diff is empty
  • ran mix credo diff --from-git-ref master /app/folder

Expected outcome

Expect no issues.

Actual outcome

Issues found in folder specified.

@dantuck
Copy link
Author

dantuck commented Feb 7, 2023

I may be doing something wrong with how I am trying to accomplish this. If there is another way I am more than open to making an update to my flow.

@dantuck
Copy link
Author

dantuck commented Feb 7, 2023

The diff ended up actually working an the issue was related to a third-party check CredoNaming that is not allowing for diff checks.

@dantuck dantuck closed this as completed Feb 7, 2023
@dantuck dantuck reopened this Feb 8, 2023
@dantuck
Copy link
Author

dantuck commented Feb 8, 2023

@rrrene reopening because I am seeing an issue. When I branch from master make only a change to the credo file and enable a check I get many warnings.

I am running the following:

 mix credo diff --from-git-ref master

@Nezteb
Copy link

Nezteb commented Apr 19, 2023

@dantuck I tried to reproduce this with version 1.7.0 but can't. What does your .credo.exs file look like?

@dantuck
Copy link
Author

dantuck commented Jun 27, 2023

There is actually a misunderstanding as to what the command is supposed to do. I accomplished what I was trying to do through a plugin. What I was intending to do was only run credo on changes in the code and not on the whole repository.

Thank you for trying to reproduce.

@dantuck dantuck closed this as completed Jun 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants