[
https://issues.apache.org/jira/browse/RAT-330?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17788109#comment-17788109
]
Claude Warren commented on RAT-330:
-----------------------------------
I was working on a project that has some files that needed to use things like
the C-style comment blocks for and odd-ball file. I looked at how the system
is configured and discovered that I could write a class to do it, but it would
also be reasonably easy to use a configuration. so that I could say something
like:
*.odd-ball : c-format
To indicate that files with the odd-ball extension should be processed as tough
they were C files.
The definitions for the file processing could be used to extract the comments
from the files on the license check side. I don't think this is done
currently, though I think that the input processing is handled by some sort of
detection and comment stripping code.
I think that RAT-150 could probably be rolled into this change. But I am not
certain how much assistance Tika is going to be when all we want to be able to
do is extract comments. That needs to be explored.
> Simplify the definition of file types.
> --------------------------------------
>
> Key: RAT-330
> URL: https://issues.apache.org/jira/browse/RAT-330
> Project: Apache Rat
> Issue Type: Improvement
> Components: engine
> Affects Versions: 0.16
> Reporter: Claude Warren
> Priority: Minor
> Original Estimate: 168h
> Remaining Estimate: 168h
>
> Currently the file types are detected in the AbstractLicenseAppender and are
> hardcoded.
>
> This change should explore
> * defining the file types in configuration files.
> * Extracting the type detection from the AbstractLicenseAppender so that it
> can be used in the text processing matchers.
> * If information about start and end block comments symbols as well as
> single line symbols should be maintained with the type.
> * If information about required initial lines should be kept with the type.
> It should also remove the dependency on IOUtils.closeQuietly() in the
> AbstractLicenseAppender.
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)