nielsbasjes commented on PR #167:
URL: https://github.com/apache/creadur-rat/pull/167#issuecomment-1828727108

   I noticed that much of the code I wrote for this project really belonged at 
the side of the gitignore library (finding and managing all the separate 
gitignore files). This was mainly because of the delicate handling needed to 
ensure that the rules are checked in the correct order.
   
   I also ran into a whole bunch of problems regarding to doing all of this in 
Windows also.
   
   So I created a `GitIgnoreFileSet` which is really container for `all the 
.gitignore files in your project`.
   
   You can create one either like this:
   
       GitIgnoreFileSet gitIgnoreFileSet = new GitIgnoreFileSet(projectBaseDir);
   
   or 
   
       GitIgnoreFileSet gitIgnoreFileSet = new GitIgnoreFileSet(projectBaseDir, 
false);
       gitIgnoreFileSet.addGitIgnoreFile(new File("somedir/.gitignore"));
   
   and then can use it like this:
   
       if(gitIgnoreFileSet.ignoreFile(filename)) {
   
   or use it as a FileFilter (you guys indicated this to be desirable)
   
       File[] normalFiles = directory.listFiles(gitIgnoreFileSet);
   
   This all means the operational code for this in this project was reduced.
   
   I have released this new version to maven central, seems I was a bit too 
fast with pushing my code here.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@creadur.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to