-
Notifications
You must be signed in to change notification settings - Fork 18
The .parlour file
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.
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
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.
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
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
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
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
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
This is an example of a complete .parlour
file, which uses the Sord::ParlourPlugin
plugin from the sord
gem, with some configuration.
output_file: rbi/project.rbi
style:
break_params: 0 # break all signatures onto their own lines
requires:
- sord
plugins:
Sord::ParlourPlugin:
replace_unresolved_with_untyped: yes