This library and its CLI supports you in linting README.md Markdown files via PHP. For inspiration for good READMEs,
please have a look at the Awesome README repository.
composer require --dev stolt/readme-lintThe following list shows the currently three available CLI commands to interact with a README.md file.
php bin/readme-lint list
readme-lint 0.0.2
Available commands:
init Create an initial README.md file in the current working directory
lint Lint a README.md file for common quality issues
spellcheck Check a README.md file for wording or spelling mistakesAvailable lint rules can be found in the Rules directory.
To configure the lint rules to apply, you have several options:
-
Create a
.readme-lint.phpfile in the root of your project, which will be used as a default configuration when present. -
Create a
some-readme-lint-configuration-file.phpfile which you pass to the CLI via an option.
php bin/readme-lint lint --config=some-readme-lint-configuration-file.php- Pass a list of rules as a comma-separated string to the CLI. You can use FQCNs or base names for the rules to apply.
php bin/readme-lint lint --rules Stolt\ReadmeLint\Rules\LogoPresenceRule,NoTodoCommentRuleNote
To add custom lint rules, you must first create classes which implement the Stolt\ReadmeLint\Rule\RuleInterface interface
and then make them available via your readme-lint configuration file like shown next.
<?php declare(strict_types=1);
use Stolt\ReadmeLint\Configuration;
use Stolt\ReadmeLint\Linter;
$configuration = new Configuration(new Linter(getcwd()));
$configuration->setCustomRulesDirectory(
'/some/path/to/custom/rules',
'Custom\Rules\Namespace'
)->addRulesToApply(['CustomRuleA', 'CustomRuleB', 'NoTodoCommentRule']);
return $configuration;composer testThis library and its CLI are licensed under the MIT license. Please see LICENSE.md for more details.
Please see CHANGELOG.md for more details.
Please see CONTRIBUTING.md for more details.
