Examples
Configuration
examples.plugin_config
This configuration example shows how to define and use a plugin
using the Plugin
class and its define_rule()
decorator method.
You can use this example directly via the Python API by passing it's
exported configuration to an instance of the Linter
class or use
the XRLint CLI:
xrlint -c examples/plugin_config.py <OPTIONS> <FILES>
Source code: examples/plugin_config.py
examples.virtual_plugin_config
This configuration example demonstrates how to define and use "virtual" plugins. Such plugins can be defined inside a configuration item.
You can use this example directly via the Python API by passing it's
exported configuration to an instance of the Linter
class or use
the XRLint CLI:
xrlint -c examples/virtual_plugin_config.py <OPTIONS> <FILES>
Source code: examples/virtual_plugin_config.py
Developing rules
examples.rule_testing
This example demonstrates how to develop new rules.
Source code: examples/rule_testing.py
API usage
examples.check_s3_bucket
This code example shows how to use the high-level Python API to validate the contents of an S3 bucket.
Source code: examples/check_s3_bucket.py