NAME
Dist::Conformance::Check::RefusedIniKeys - An INI file, such as dist.ini, sets no key that the flavor refuses, and the update removes each one
VERSION
version 0.004
DESCRIPTION
Some keys of an INI file do harm wherever they are set, and the fix is always to remove them. user under [GithubMeta] in dist.ini is one: it overrides the account in the URL of the origin remote, so the metadata of the distribution can name the wrong repository. Dist::Conformance::Check::DataSchema can refuse such a key, but it cannot remove it, because a schema says what is wrong and not how to fix it.
This check fails when a section of file sets a key that refuse names for it, and the detail names each such key, its section and the reason. It passes when there is none. The file is read as "parse_ini" in Dist::Conformance::Schema reads it, and a file that does not parse fails.
A section of refuse is the name of a plugin. It matches the section with that header, and each section with that header followed by / and a name of its own, as Dist::Zilla writes a plugin that it loads twice: GithubMeta matches [GithubMeta] and [GithubMeta / Meta]. The keys before the first header are in the section _.
The update removes each line that sets a refused key, and nothing else. It edits the file as text, so every other line, every comment and the order stay as they were. The lines are found by the methods of Config::INI::Reader that read the file, so the update removes what the check reads. A file that does not parse is left for a person.
METHODS
refused
($text). The lines of the INI file $text that set a refused key, in their order, as hash references with the line, counted from 0, the section, the key and the reason. Dies when the text does not parse.
check
($snapshot). The status and the detail that "DESCRIPTION" says, for the file in $snapshot.
update
Removes each line that sets a refused key, or says what is wrong when the file does not parse.
IN A FLAVOR
checks:
GithubMetaFromRemote:
module: RefusedIniKeys
file: dist.ini
refuse:
GithubMeta:
user: overrides the account in the URL of the origin remote
CONFIGURATION
- file
-
Required. The path of the INI file.
- refuse
-
Required. A mapping from the name of a plugin to a mapping from each key that it must not set to the reason, which the detail gives.
- missing
-
The status when the file is absent. Default
info, because a repository without the file sets no key of it.
SEE ALSO
Please see those modules/websites for more information related to this module.
BUGS
Please report any bugs or feature requests on the bugtracker website https://github.com/Troglodyne-Internet-Widgets/Dist-Conformance/issues
When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.
AUTHORS
Current Maintainers:
George S. Baugh <george@troglodyne.net>
COPYRIGHT AND LICENSE
Copyright (c) 2026 Troglodyne LLC
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.