A license consists of the following file, where is the license key: - .LICENSE: the license text and the license data in YAML frontmatter A License object is identified by a unique `key` and its data stored in the `src_dir` directory. Key is a lower-case unique ascii
| 110 | |
| 111 | @attr.s(slots=True) |
| 112 | class License: |
| 113 | """ |
| 114 | A license consists of the following file, where <key> is the license key: |
| 115 | - <key>.LICENSE: the license text and the license data in YAML frontmatter |
| 116 | |
| 117 | A License object is identified by a unique `key` and its data stored in the |
| 118 | `src_dir` directory. Key is a lower-case unique ascii string. |
| 119 | """ |
| 120 | |
| 121 | key = attr.ib( |
| 122 | repr=True, |
| 123 | metadata=dict( |
| 124 | help='Mandatory unique key: this is a lower case string with only ' |
| 125 | 'ASCII characters, digits, underscore or dots.') |
| 126 | ) |
| 127 | |
| 128 | is_deprecated = attr.ib( |
| 129 | default=False, |
| 130 | repr=False, |
| 131 | metadata=dict( |
| 132 | help='Flag set to True if this is a deprecated license. ' |
| 133 | 'The policy is to never delete a license key once attributed. ' |
| 134 | 'Instead it can be marked as deprecated and will be ignored for ' |
| 135 | 'detection. When marking a license as deprecated, add notes ' |
| 136 | 'explaining why this is deprecated. And all license rules must be ' |
| 137 | 'updated accordingly to point to a new license expression.') |
| 138 | ) |
| 139 | |
| 140 | replaced_by = attr.ib( |
| 141 | default=[], |
| 142 | repr=False, |
| 143 | metadata=dict( |
| 144 | help='A list of new license expressions that replace this license, ' |
| 145 | 'only if deprecated and replaced by something else.') |
| 146 | ) |
| 147 | |
| 148 | language = attr.ib( |
| 149 | default='en', |
| 150 | repr=False, |
| 151 | metadata=dict( |
| 152 | help='Two-letter ISO 639-1 language code if this license text is ' |
| 153 | 'not in English. See https://en.wikipedia.org/wiki/ISO_639-1 . ' |
| 154 | 'NOTE: each translation of a license text MUST have a different ' |
| 155 | 'license key. By convention, we append the language code to the ' |
| 156 | 'license key') |
| 157 | ) |
| 158 | |
| 159 | short_name = attr.ib( |
| 160 | default=None, |
| 161 | repr=False, |
| 162 | metadata=dict( |
| 163 | help='Commonly used license short name, often abbreviated.') |
| 164 | ) |
| 165 | |
| 166 | name = attr.ib( |
| 167 | default=None, |
| 168 | repr=False, |
| 169 | metadata=dict( |
no test coverage detected