Repository navigation
Conversation
|
Since you are adding a couple of editors to this can you check if Tika tells us the content type, if so it should be in the Document.metadata object. Also, let's think about breaking the editors into separate classes that implement an interface that does the edit so one editor for each class of files. I think it will simplify the code and make it clearer. Also, I am not certain we should continue to do this in RAT going forward. In my opinion RAT should tell you what the problems are, not attempt to correct them. There are a number of other tools that will insert headers if that is what you want to do. |
- Added a LicenseEditor interface and separate editors for Markdown, declarations, first-line markers, Visual Studio solutions, and plain insertion under apache-rat-core/src/main/java/org/apache/rat/annotation/. - Updated LicenseAddingReport.java to pass Tika’s existing document metadata to the appender. - Added MIME-type fallback for Markdown, XML, and HTML while preserving extension-based behavior. - Preserved Markdown front matter handling and error cleanup.
|
Applied your review comments and extracted editor classes for each type of document.
I totally see your point but from a customer perspective I'd love to use the tool to insert heders in order to help me properly address the issues reported. I guess that's the reason why this functionality was added ..... WDYT? |
|
|
Thanks Philipp! The Markdown handling looks like the right direction. One thing seems to be missing for AsciiDoc: Hugo uses the same YAML/TOML/JSON front matter for
Could the front matter handling be shared between both editors, keeping the appropriate comment syntax for each format? |



@snazy is this how you want RAT-517 to do the license insertion while preserving the front matter?
Scope: Markdown with YAML-frontmatter & asciidoc handling