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

Cannot comment out lines in .rspec #2985

Closed
JunichiIto opened this issue Nov 29, 2022 · 2 comments · Fixed by #2984
Closed

Cannot comment out lines in .rspec #2985

JunichiIto opened this issue Nov 29, 2022 · 2 comments · Fixed by #2984

Comments

@JunichiIto
Copy link
Contributor

Subject of the issue

As far as I see, there is no way to comment out lines in .rspec

Your environment

  • Ruby version: 3.1.0
  • rspec-core version: 3.12.0

Steps to reproduce

Save .rspec like this:

# --format d

And run specs:

bundle exec rspec

Expected behavior

The format option is ignored.

Actual behavior

The format option (--format d) is applied.

I think it would be useful if we can comment out configurations in .rspec by putting # .

This PR resolves this: #2984

@JonRowe
Copy link
Member

JonRowe commented Nov 29, 2022

Why not just delete the lines? The .rspec file is expected to contain shell like commands and comments would not be valid on the command line either?

@JunichiIto
Copy link
Contributor Author

Here is my use case. I added the line below for an experimental purpose:

--tag ~slow

And I wanted to run all tests, so I added #, but it didn't work (--tag ~slow is still applied):

# --tag ~slow

Of course, I can delete the line, but I need to type --tag ~slow again if I want to revert it. Adding/removing # is much more useful than deleting/typing all charactors.

Moreover, config files such as .gitignore, .zshrc or .env support commenting out with #, so I expect .rspec would also work in the same way. It was surprising for me when I saw # was just ignored and --tag ~slow was applied. It was difficult for me to expect such a behvior.

I guess supporting # comment would be useful and easy to understand for the most developers.

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 a pull request may close this issue.

2 participants