mavsolutions / yaml-linter
A Symfony cli command utility for checking YAML file syntax
Installs: 72
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/mavsolutions/yaml-linter
Requires
- composer-runtime-api: ^2
- symfony/console: ^5 | ^6 | ^7
- symfony/finder: ^5 | ^6 | ^7
- symfony/yaml: ^5 | ^6 | ^7
Requires (Dev)
- roave/security-advisories: dev-latest
README
Wrapper for symfony/yaml's LintCommand (see Symfony/Yaml)
Call it like Symfony's LintCommand with filename as arguments, single files as exclude-Option and with additional option excludePattern.
ExcludePattern are parsed with symfony/finder (see Symfony/Finder) as path and all matching yaml|yml are added to LintCommand's exclude-options.
use-case
In some projects one might use local composer-packages which have their own frontend-buildchain. This buildchain might integrate some third-party libraries into your project-structure with malformed yaml-files which you don't need to care for.
├── composer.json
├── src
…
└── packages
└── local-subpackage
├── composer.json
├── Configuration
├── Documentation
├── Resources
│ ├── node_modules
│ │ ├── some third party npm-packages
│ │ └── …
│ ├── package.json
│ ├── Sources
│ ├── webpack.config.js
│ └── yarn.lock
…
When scanning this whole project with a yaml-lint-command I got some errors from node_modules-subdirectories. You should for sure validate those error-messages, create several pull-requests to the third-party repos, patch your local files while waiting for pr to be merged - but to be honest in real life you only need a "green pipeline".
Example
vandor/bin/yaml-linter src --excludePattern=thirdParty