Pull request: Fix a bug in setting gemspec license#93
Open
rleber wants to merge 3 commits intopiotrmurach:masterfrom
Open
Pull request: Fix a bug in setting gemspec license#93rleber wants to merge 3 commits intopiotrmurach:masterfrom
rleber wants to merge 3 commits intopiotrmurach:masterfrom
Conversation
houndci-bot
reviewed
Jun 10, 2025
| gem_license = " " * gemspec.pre_var_indent | ||
| gem_license << "#{gemspec.var_name}.license" | ||
| gem_license << " " * (gemspec.post_var_indent - ".license".size) | ||
| gem_license << " " * [(gemspec.post_var_indent - ".license".size), 0].max |
There was a problem hiding this comment.
Performance/FixedSize: Do not compute the size of statically sized objects.
Metrics/LineLength: Line is too long. [83/80]
hvpaiva
suggested changes
Mar 20, 2026
| gem_license = " " * gemspec.pre_var_indent | ||
| gem_license << "#{gemspec.var_name}.license" | ||
| gem_license << " " * (gemspec.post_var_indent - ".license".size) | ||
| gem_license << " " * [(gemspec.post_var_indent - ".license".size), 0].max |
There was a problem hiding this comment.
Suggested change
| gem_license << " " * [(gemspec.post_var_indent - ".license".size), 0].max | |
| gem_license << " " * [(gemspec.post_var_indent - ".license".size), 1].max |
Using 0 as the minimum would produce spec.license= "MIT" (no space before =), which is inconsistent with the format bundler generates for other attributes (e.g. spec.name = "sandbox"). A minimum of 1 ensures the output matches the surrounding style.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Describe the change
Corrects an error I experienced trying to run
teletype new: the count of spaces to add in padding the license for the gemspec was negative. I fixed this by ensuring that the padding count is always >= 0.I also added .envrc to the .gitignore file, since I use direnv locally, but I don't think my settings should be included in the repository.
Why are we doing this?
This bug caused
teletype newto fail.Benefits
This makes the tool more reliable.
Drawbacks
None
Requirements
masterbranch?Note: Several test fail -- but they were already failing when I cloned the repo, before I made any changes.