Restyler Info Yaml

Every Restyler is described by a file at {name}/info.yaml in the restylers repository. This page documents that file.

Minimal example #

name: foo
version_cmd: |
  foo --version  

Maximal example #

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        

Schema Details #

Key Type Default value Details
enabled bool false Run in the default configuration?
name string required Unique name for this Restyler
version_cmd1 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[].support2 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

  1. One of version_cmd (preferred) or version is required ↩︎

  2. A tests[].support file will be present for all test cases if any test case defines it ↩︎