Skip to content

The .parlour file

Aaron Christiansen edited this page Jul 10, 2019 · 4 revisions

Overview

The .parlour file is a YAML file which should reside in the root of your project. It must define your output RBI file, and can then optionally define your styles, required files, and plugins.

Options

output_file (Required)

Defines the file which the generated RBI file will be written to. This path is relative to the location of your .parlour file.

output_file: rbi/project.rbi

style

Overrides the default styling options used when generating RBIs. You can specify any number of the options listed below; unspecified options will use their defaults.

tab_size

Changes the number of spaces used for each indentation in the RBI file. Defaults to 2 spaces.

style:
  tab_size: 4 # use 4 spaces per indent instead of 2

break_params

If the number of parameters in a Sorbet method signature (sig) is equal to or greater than this number, then the signature is broken onto multiple lines. Defaults to 4.

style:
  break_params: 0 # break all signatures across multiple lines

requires

An array of gems which should be required (using require) to allow all specified plugins to be resolved. Defaults to none.

requires: 
  - a_gem_containing_a_plugin
  - another_gem

relative_requires

An array of file paths, relative to .parlour, which should be required (using require_relative) to allow all specified plugins to be resolved. Defaults to none.

relative_requires: 
  - parlour_plugins/some_plugin.rb
  - parlour_plugins/some_other_plugin.rb

plugins

An associative array of plugin names to the configuration for that plugin. A plugin's name is its full module/class path. Plugin configuration should be an associative array; if you do not need to specify any configuration, then write {}.

plugins: 
  Gem1::Plugin: {} # no configuration
  Gem2::Plugin: # two configuration options, foo and bar
    foo: 2
    bar: 4
Clone this wiki locally