Skip to content
This repository was archived by the owner on Mar 12, 2026. It is now read-only.
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions text/0000-bundle-canonical.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
- Feature Name: bundle_canonical
- Start Date: 2018-08-03
- RFC PR:
- Bundler Issue:

# Summary

Add a new `bundle canonical` feature. The `bundle canonical` command will modify the gemfile by giving it consistent formatting and beautify it by adding summary of the gems if required.

The purpose of this RFC is to get feedback on use cases, cli format/syntax, and feature options.

# Motivation

The main use case is to make a large (maybe not easily maintainable) Gemfile consistent.

# Detailed design

The usage:

```ruby
# Gemfile

source "https://rubygems.org/"

gem "rack"
```

```bash
$ bundle canonical
```

```ruby
# Gemfile after

source "https://rubygems.org/"

# a modular Ruby webserver interface
gem "rack"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good to have a lot more examples that reflect more real-world Gemfiles and how this command modifies them:

  • How does this work on really large Gemfiles?
  • How does it handle comments inside a Gemfile?
  • How does it handle Gemfiles that have ruby code inside it?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently, it only works well for a standard Gemfile.

```

Adding `--dry-run` option does not change the Gemfile rather shows what the Gemfile would look like if run without `--dry-run`.

# How We Teach This

An addition to the documentation. To bring awareness among users, I can think of normal blog articles, and/or bundler press/social media channels.

# Drawbacks

I don't think there are any.