creadur-rat icon indicating copy to clipboard operation
creadur-rat copied to clipboard

RAT-390 migrate exclusion config - (Harmonize Part 6)

Open Claudenw opened this issue 1 year ago • 0 comments

Moved exclusion calculations from plugin to core which involved refactoring and reimplementing to better fit into the design.

Largest changes are:

  • Code in apache-rat-plugin that dealt with inclusion and exclusion of files to process was moved into the core o.a.r.config.exclusion package and its sub packages. All of the inclusion and exclusion processing is handled by the ExclusionProcessor. The exclusion package is the largest change in the codebase as it is both in core (where things are added) and plugin (where things are removed).
  • A DocumentNameMatcher interface is defined in the o.a.r.document.impl package. implementations of this class are used in the filtering process.
  • A DocumentName class has been created in o.a.r.document.impl package. The name is associated with all Documents. The document name tracks both the fully qualified path to the file on the file system as well as the base directory that the file was referenced from. This class is where filenames are localized to the directory where rat starts it's scan. A lot of the churn in this PR is to push the DocumentName into the Document across the codebase.
  • The Plexus code that we use to match file patterns has be copied into o.a.r.config.exclusion.plexus . These files have been modified from their original.
  • An o.a.r.utils.iterator package has been added. It contains extended iterator code from Apache Jena that is slightly modified to fit our needs. This code allows us to use iterators in ways similar to streams but without the overhead.
  • Added more tests.

Claudenw avatar Sep 05 '24 09:09 Claudenw