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

Ignore files in .gitignore #49

Open
vrevelas opened this issue Jan 30, 2020 · 6 comments
Open

Ignore files in .gitignore #49

vrevelas opened this issue Jan 30, 2020 · 6 comments

Comments

@vrevelas
Copy link
Contributor

It would be nice if the plugin ignored files that match patterns in .gitignore by default. I currently have to add new directories (e.g. node_modules) to both .gitignore and to the plugin's in my pom.xml.

dwalluck added a commit to dwalluck/editorconfig-maven-plugin that referenced this issue May 6, 2020
@dwalluck
Copy link
Contributor

dwalluck commented May 6, 2020

I've submitted #53 which allows a single file to be used for exclude patterns. There are many ignore-type files (not just .gitignore) and .gitignore can appear in any directory which is more complicated to deal with.

Still, this is hopefully enough for you as you can set <excludesFile>.gitignore</excludesFile>.

@ppalaga
Copy link
Collaborator

ppalaga commented May 7, 2020

+1 for adding an option to exclude files ignored by git.

I'd prefer an implementation based on a proper .gitignore parser and proper evaluation of the patterns as documented in https://git-scm.com/docs/gitignore . JGit might contain all we need and I would not mind having a non-optional JGit dependency because of this.

The proposal in #53 does not meet the above requirement.

ppalaga added a commit that referenced this issue May 7, 2020
Add excludesFile parameter
@dwalluck
Copy link
Contributor

dwalluck commented Jul 1, 2020

@ppalaga I recently noticed that, in a multi-module project, the exlcudesFile parameter is failing if the file does not exist in every module. This looks to be my fault. Either we should modify the option not to fail if the file is missing, or have a single file for the entire project. Something like .gitignore may appear in other directories, but it certainly is not required. Appologies if I should not have reported this on this ticket.

@ppalaga
Copy link
Collaborator

ppalaga commented Jul 1, 2020

Yeah, please open a new ticket. A fix is welcome!

@StefanD986
Copy link

Another idea would be to only format scm tracked files. That I think would be easier to implement because then you can just rely on the maven-scm-plugin to get the list of files tracked by the scm.

The other advantage of that would be that its not only git specific. (While git is probably the most used scm nowadays I'd say there are still a fair amount of non-git tracked projects out there)

@FibreFoX
Copy link

@StefanD986 There is a problem when relying on tracked files only, because I would need to add these files before running this plugin. In my workflow I tend to git add files after I created several lines. It would result in having a "everything is fine" due to my new files not being tracked yet, but after having them added, the plugin would tell me "omg, what have you done". I would want to have this feedback faster.

So I would advocate to have .gitignore being one source file for this filtering, instead of relying on current tracked state.

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

5 participants