[
https://issues.apache.org/jira/browse/RAT-321?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17753469#comment-17753469
]
Claude Warren commented on RAT-321:
-----------------------------------
My thought is to remove as much of the hard coding as possible and replace
it with one default configuration file. then allow the user to add one or
more additional configuration files and/or ignore the default one.
I was thinking of a configuration that looks one of these:
{noformat}
--- JSON ---
{
families : {
'{category}': 'name',
},
licenses : [
{
family : '{category}',
notes: 'notes',
spdx: 'spdx',
fulltext: 'text',
copyright: 'copyright',
text = ['text1','text2'],
}],
}
--- RDF ---
family:{catagory} [
name=' '
]
license:id [
family family:{catagory}
notes=''
spdx=''
fulltext=''
copyright=''
text='text1'
text='text2'
]
--- XML ---
<config>
<family category='{category}'>
name text
</family>
<license id="lxx' family='{category}' spdx='spdxtx'>
<notes>notes text</notes>
<fulltext>full text</fulltext>
<copyright>copyright</copyright>
<text>text1</text>
<text>text2</text>
</license>
</config>
--- CONFIG / properties ---
family.{category}.name=text
license.id.family={category}
license.id.notes=
license.id.fullText=
license.id.copyright=
license.id.text.1=
license.id.text.2=
license.id.spdx=
{noformat}
The idea is to have one section to define the various families which only
seem to have a common 5-character category and a name. We use the category
as the id for hte family and attach a name to it.
And another section to define the licenses. Since we support several types
I think we can do it by creating the various implementations of BaseLicense.
While the plan is to remove as much hard code as possible, the goal is to
build BaseLicense as it is now without change. This change only affects the
initial creation of the BaseLicenses used in the tool.
I plan to get the CLI to work first and then we can port the functionality
to the other clients.
My peliminary work is on
https://github.com/claudenw/creadur-rat/tree/RAT-321_text_based_configuration
This is very preliminary and does not work. However, it does provide some
idea of the changes I am considering.
Claude
On Tue, Aug 8, 2023 at 11:14 PM Philipp Ottlinger (Jira) <[email protected]>
> Allow configuration to define SimplePatternBasedLicense instances
> -----------------------------------------------------------------
>
> Key: RAT-321
> URL: https://issues.apache.org/jira/browse/RAT-321
> Project: Apache Rat
> Issue Type: Improvement
> Components: engine
> Affects Versions: 0.15
> Reporter: Claude Warren
> Priority: Minor
>
> The concept here is to rework the license matching definitions so that the
> SimplePatternBasedLicense can be instantiated from a configuration file.
> The reasoning is that there are a number of licences that are of particular
> interest in projects both inside and outside of the ASF that are not
> currently included in the code. This change will allow users to define the
> string matching for any license that can be matched by simple string matching.
> The proposal is to move all the static definitions into a default file and
> allow the default to be ignored/overridden.
> *Command Line Flags*
> Add a flag --no-default-file to skip reading the default definitions from
> within the package.
> Add a flag --definition-file that accepts a file name argument, reads it and
> adds the definitions to the list of definitions that are checked. Ensure
> that multiple --definition-file arguments may provided and that they are
> added in the order in the --definition-file.
> *Static definition changes*
> * Modify Meta.Data so that the license family category values are not
> statically defined.
> * Modify Meta.Data so that the license family names are not statically
> defined.
>
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)