Closed JunichiIto closed 1 year ago
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?
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.
Subject of the issue
As far as I see, there is no way to comment out lines in .rspec
Your environment
Steps to reproduce
Save .rspec like this:
And run specs:
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: https://github.com/rspec/rspec-core/pull/2984