https://github.com/php/docbook-cs
https://github.com/php/docbook-cs
Last synced: 22 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/php/docbook-cs
- Owner: php
- License: apache-2.0
- Created: 2026-04-04T19:00:10.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2026-04-30T20:37:41.000Z (about 2 months ago)
- Last Synced: 2026-05-30T00:32:39.342Z (22 days ago)
- Language: PHP
- Homepage: https://php.github.io/docbook-cs/
- Size: 483 KB
- Stars: 4
- Watchers: 0
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
- Notice: NOTICE
Awesome Lists containing this project
README
# DocbookCS
A static-analysis linter for DocBook XML files. It scans XML documentation sources and reports style and convention violations.
**Full documentation:** [jordikroon.github.io/docbook-cs](https://jordikroon.github.io/docbook-cs)
---
## Contributing
### Requirements
- PHP 8.5+
- Extensions: `dom`, `libxml`, `simplexml`
### Setup
```bash
composer install
```
### Running checks
```bash
# Tests
vendor/bin/phpunit
# Static analysis
vendor/bin/phpstan
# Code style
vendor/bin/phpcs
```
### Writing a sniff
Implement `DocbookCS\Sniff\SniffInterface` (or extend `AbstractSniff`):
```php
namespace Acme\DocbookSniffs;
use DocbookCS\Sniff\AbstractSniff;
final class MySniff extends AbstractSniff
{
public function getCode(): string
{
return 'Acme.MySniff';
}
public function process(\DOMDocument $document, string $content, string $filePath): array
{
$violations = [];
// ... inspect $document, add violations via $this->createViolation(...)
return $violations;
}
}
```
Register it in your config:
```xml
```
## License
Apache 2.0