-
Notifications
You must be signed in to change notification settings - Fork 28
Restyler Info Schema
Pat Brisbin edited this page Nov 12, 2024
·
1 revision
Every Restyler is described by a file at {name}/info.yaml
in this repository. This page
documents that file.
name: foo
version_cmd: |
foo --version
enabled: false
name: foo
version_cmd: |
foo --version
command:
- foo
arguments: []
include: []
interpreters: []
supports_arg_sep: true
supports_multiple_path: true
run_as_filter: false
documentation: []
metadata:
languages: []
tests:
- name: Description of this test case
support:
path: x.conf
contents: |
Content for x.conf
extension: .foo
contents: |
Content before fixing
restyled: |
Content after fixing
Key | Type | Default value | Details |
---|---|---|---|
enabled |
bool |
false |
Run in the default configuration? |
name |
string |
required | Unique name for this Restyler |
version_cmd * |
string |
A command to run to get the Restyler's version | |
version |
string |
An explicit version to use (overrides version_cmd ) |
|
command |
[string] |
[$name] |
Auto-formatting command, and any "all the time" argument (e.g. --inplace ) |
arguments |
[string] |
[] |
Additional arguments to include by default, but not required to function |
include |
[pattern] |
[] |
Include Patterns to match files this Restyler should operate on |
interpreters |
[interpreter] |
[] |
Interpreters to match extension-less files this Restyler should operate on |
supports_arg_sep |
bool |
true |
Does this Restyler support -- to separate paths from options? |
supports_multiple_path |
bool |
true |
Does this Restyler accept multiple paths at once? |
run_as_filter |
bool |
false |
Capture the tool's stdout and rewrite the file ourselves? |
documentation |
[string] |
[] |
URLs to documentation that is useful during configuration or trouble-shooting |
metadata |
Metadata |
||
metadata.languages |
[string] |
[] |
Free-form names of languages this Restyler supports |
metadata.tests |
[Test] |
[] |
|
metadata.tests[].name |
string |
Test #{n} |
Descriptive name for the test |
metadata.tests[].support ** |
Support |
none | Support file (e.g. .rubocop.yaml ) needed for the test |
metadata.tests[].support.path |
string |
required | Name of the file |
metadata.tests[].support.contents |
string |
required | Contents of the file |
metadata.tests[].extension |
string |
.temp |
Extension to use for restyled file |
metadata.tests[].contents |
string |
required | Content to be restyled as the test |
metadata.tests[].restyled |
string |
required | Expected content after restyling |
*: One of version_cmd
(preferred) or version
is required
**: A tests[].support
file will be present for all test cases if any test case defines it