README.md in tapioca-0.6.1 vs README.md in tapioca-0.6.2

- old
+ new

@@ -78,47 +78,48 @@ Command: `tapioca init` This will create the `sorbet/config` and `sorbet/tapioca/require.rb` files for you, if they don't exist. If any of the files already exist, they will not be changed. +<!-- START_HELP_COMMAND_INIT --> ```shell -$ bundle exec tapioca help init Usage: tapioca init Options: -c, [--config=<config file path>] # Path to the Tapioca configuration file # Default: sorbet/tapioca/config.yml -V, [--verbose], [--no-verbose] # Verbose output for debugging purposes initializes folder structure ``` +<!-- END_HELP_COMMAND_INIT --> ### Generate RBI files for gems Command: `tapioca gem [gems...]` This will generate RBIs for the specified gems and place them in the RBI directory. +<!-- START_HELP_COMMAND_GEM --> ```shell -$ bundle exec tapioca help gem Usage: tapioca gem [gem...] Options: - --out, -o, [--outdir=directory] # The output directory for generated RBI files + --out, -o, [--outdir=directory] # The output directory for generated gem RBI files # Default: sorbet/rbi/gems [--file-header], [--no-file-header] # Add a "This file is generated" header on top of each generated RBI file # Default: true [--all], [--no-all] # Regenerate RBI files for all gems --pre, -b, [--prerequire=file] # A file to be required before Bundler.require is called --post, -a, [--postrequire=file] # A file to be required after Bundler.require is called # Default: sorbet/tapioca/require.rb - -x, [--exclude=gem [gem ...]] # Excludes the given gem(s) from RBI generation - --typed, -t, [--typed-overrides=gem:level [gem:level ...]] # Overrides for typed sigils for generated gem RBIs + -x, [--exclude=gem [gem ...]] # Exclude the given gem(s) from RBI generation + --typed, -t, [--typed-overrides=gem:level [gem:level ...]] # Override for typed sigils for generated gem RBIs # Default: {"activesupport"=>"false"} - [--verify], [--no-verify] # Verifies RBIs are up-to-date + [--verify], [--no-verify] # Verify RBIs are up-to-date [--doc], [--no-doc] # Include YARD documentation from sources when generating RBIs. Warning: this might be slow [--exported-gem-rbis], [--no-exported-gem-rbis] # Include RBIs found in the `rbi/` directory of the gem # Default: true -w, [--workers=N] # EXPERIMENTAL: Number of parallel workers to use when generating RBIs # Default: 1 @@ -126,62 +127,66 @@ # Default: sorbet/tapioca/config.yml -V, [--verbose], [--no-verbose] # Verbose output for debugging purposes generate RBIs from gems ``` +<!-- END_HELP_COMMAND_GEM --> ### Generate the list of all unresolved constants Command: `tapioca todo` This will generate the file `sorbet/rbi/todo.rbi` defining all unresolved constants as empty modules. +<!-- START_HELP_COMMAND_TODO --> ```shell -$ bundle exec tapioca help todo Usage: tapioca todo Options: - [--todo-file=TODO_FILE] + [--todo-file=TODO_FILE] # Path to the generated todo RBI file # Default: sorbet/rbi/todo.rbi [--file-header], [--no-file-header] # Add a "This file is generated" header on top of each generated RBI file # Default: true -c, [--config=<config file path>] # Path to the Tapioca configuration file # Default: sorbet/tapioca/config.yml -V, [--verbose], [--no-verbose] # Verbose output for debugging purposes generate the list of unresolved constants ``` +<!-- END_HELP_COMMAND_TODO --> ### Generate DSL RBI files Command: `tapioca dsl [constant...]` This will generate DSL RBIs for specified constants (or for all handled constants, if a constant name is not supplied). You can read about DSL RBI generators supplied by `tapioca` in [the manual](manual/generators.md). +<!-- START_HELP_COMMAND_DSL --> ```shell -$ bundle exec tapioca help dsl Usage: tapioca dsl [constant...] Options: - --out, -o, [--outdir=directory] # The output directory for generated RBI files + --out, -o, [--outdir=directory] # The output directory for generated DSL RBI files # Default: sorbet/rbi/dsl [--file-header], [--no-file-header] # Add a "This file is generated" header on top of each generated RBI file # Default: true - [--only=generator [generator ...]] # Only run supplied DSL generators - [--exclude=generator [generator ...]] # Exclude supplied DSL generators + [--only=generator [generator ...]] # Only run supplied DSL generator(s) + [--exclude=generator [generator ...]] # Exclude supplied DSL generator(s) [--verify], [--no-verify] # Verifies RBIs are up-to-date -q, [--quiet], [--no-quiet] # Supresses file creation output -w, [--workers=N] # EXPERIMENTAL: Number of parallel workers to use when generating RBIs # Default: 1 -c, [--config=<config file path>] # Path to the Tapioca configuration file # Default: sorbet/tapioca/config.yml -V, [--verbose], [--no-verbose] # Verbose output for debugging purposes generate RBIs for dynamic methods ``` +<!-- END_HELP_COMMAND_DSL --> + ## Configuration Tapioca supports loading command defaults from a configuration file. The default configuration file location is `sorbet/tapioca/config.yml` but this default can be changed using the `--config` flag and supplying an alternative configuration file path. @@ -190,22 +195,59 @@ For example, if you always want to generate gem RBIs with inline documentation, then you would create the file `sorbet/tapioca/config.yml` as: ```yaml gem: - docs: true + doc: true ``` Additionally, if you always want to exclude the `AASM` and `ActiveRecordFixtures` DSL compilers in your DSL RBI generation runs, your config file would then look like this: ```yaml gem: - docs: true + doc: true dsl: exclude: - UrlHelpers - ActiveRecordFixtures ``` + +The full configuration file, with each option and its default value, would look something like this: +<!-- START_CONFIG_TEMPLATE --> +```yaml +--- +require: + postrequire: sorbet/tapioca/require.rb +todo: + todo_file: sorbet/rbi/todo.rbi + file_header: true +dsl: + outdir: sorbet/rbi/dsl + file_header: true + only: [] + exclude: [] + verify: false + quiet: false + workers: 1 +gem: + outdir: sorbet/rbi/gems + file_header: true + all: false + prerequire: '' + postrequire: sorbet/tapioca/require.rb + exclude: [] + typed_overrides: + activesupport: 'false' + verify: false + doc: false + exported_gem_rbis: true + workers: 1 +clean_shims: + gem_rbi_dir: sorbet/rbi/gems + dsl_rbi_dir: sorbet/rbi/dsl + shim_rbi_dir: sorbet/rbi/shims +``` +<!-- END_CONFIG_TEMPLATE --> ## Contributing Bug reports and pull requests are welcome on GitHub at https://github.com/Shopify/tapioca. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](https://github.com/Shopify/tapioca/blob/main/CODE_OF_CONDUCT.md) code of conduct.