Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: [experimental] added .rtx.toml #241

Merged
merged 1 commit into from
Mar 1, 2023
Merged

feat: [experimental] added .rtx.toml #241

merged 1 commit into from
Mar 1, 2023

Conversation

jdx
Copy link
Owner

@jdx jdx commented Mar 1, 2023

This is an alternative format to .tool-versions that will be much more extensible. This enables a lot more than just a new format. It includes:

  • arbitrary env vars like dotenv
  • ability to pass options like "venv = '.venv'" to tool install scripts
  • hierarchical settings (e.g.: use "missing_runtime_behavior=autoinstall" in just one project rather than only global settings)

This will be experimental functionality gated behind RTX_EXPERIMENTAL=1. The format and functionality are subject to change within minor versions of rtx.

[env]
NODE_ENV = 'production' # supports arbitrary env vars so rtx can be used like dotenv
env = '.env' # alternatively, specify a path to env file

[tools]
# just specify a single version, no need to make this ['1.0.0']
terraform = '1.0.0'

# supports everything you can do with .tool-versions currently
nodejs = ['16', 'prefix:18', 'ref:master', 'path:~/.nodes/14']

# repo can be used to git clone a custom repo url (see #226)
jq = { version = '1.6', repo = 'https://github.com/AZMCode/asdf-jq' }

# "prefix" instead of "version" and maybe "exact"
golang = [{ prefix = '1.20' }, {exact = '1.20'}]

# send arbitrary options to the plugin, passed as:
# RTX_TOOL_OPTS__VENV=.venv
# RTX_TOOL_OPTS__DEFAULT_PACKAGES__0=ansible
# RTX_TOOL_OPTS__DEFAULT_PACKAGES__1=pipenv
python = { version = '3.10', venv = '.venv', default_packages = ['ansible', 'pipenv'] }

# allows for hierarchical settings rather than a single global file in ~/.config/rtx/config.toml
[settings]
verbose = true
missing_runtime_behavior = 'warn'
shims_dir = '~/.rtx/shims'

[alias.nodejs] # aliases can be hierarchical too
my_custom_node = '18'

Tasks

  • env var support
  • arbitrary tool options
  • single version: '1.0.0'
  • multiple versions: ['1.0.0', '1.0.1']
  • colon-style tool versions: prefix:18, ref:master, path:~/.nodes/14
  • custom plugin urls: repo = "https://...
  • project-local aliases
  • project-local settings

@codecov
Copy link

codecov bot commented Mar 1, 2023

Codecov Report

Patch coverage: 82.42% and project coverage change: -0.52 ⚠️

Comparison is base (965c535) 90.46% compared to head (1090717) 89.94%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #241      +/-   ##
==========================================
- Coverage   90.46%   89.94%   -0.52%     
==========================================
  Files          96       97       +1     
  Lines        7675     8253     +578     
==========================================
+ Hits         6943     7423     +480     
- Misses        732      830      +98     
Impacted Files Coverage Δ
src/cli/args/runtime.rs 94.73% <0.00%> (ø)
src/output.rs 84.21% <0.00%> (-7.22%) ⬇️
src/plugins/mod.rs 88.56% <ø> (ø)
src/config/config_file/rtxrc.rs 84.57% <25.00%> (-0.91%) ⬇️
src/config/config_file/tool_versions.rs 79.24% <46.15%> (-0.26%) ⬇️
src/config/config_file/legacy_version.rs 47.61% <50.00%> (+5.51%) ⬆️
src/config/config_file/rtx_toml.rs 79.48% <79.48%> (ø)
src/config/mod.rs 89.57% <86.36%> (-2.04%) ⬇️
src/runtimes.rs 87.09% <89.65%> (-0.69%) ⬇️
src/cli/direnv/envrc.rs 97.43% <100.00%> (ø)
... and 19 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@jdx jdx changed the title feat: added .rtx.toml feat: [experimental] added .rtx.toml Mar 1, 2023
@jdx jdx linked an issue Mar 1, 2023 that may be closed by this pull request
@jdx jdx force-pushed the rtx-toml branch 5 times, most recently from 678dcee to 4d9b236 Compare March 1, 2023 23:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant