-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
[Fix #1682] Add STDIN support #2146
Conversation
@caseywebdev does |
@steelbrain The path is passed just the same as it always is, as the last command line argument. The See the example above. |
Although this is not my repo, but it would be nice if you would add some tests to it. |
I would, but the rspec DSL makes me crazy. |
👍 |
@caseywebdev I think you should add validation for the new option, checking that exactly one file argument is given. And you need to add testing. Even if you're not used to RSpec. |
33cb047
to
db16986
Compare
@jonas054 I've added tests |
The code looks good to me. You just need to add the option to the Command flag table on the README page. Mention that it's useful for editor integration. |
Added |
👍 I'm satisfied. We'll see if @bbatsov has more comments. |
Apart from the failing build - the code looks good to me. |
Whoops, forgot to update the help output spec. It should pass this time. |
@@ -60,6 +60,40 @@ def INVALID_CODE | |||
END | |||
end | |||
end | |||
|
|||
context 'if -s/--stdin is used with an offense' do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where do you pass args to the runner?
I'd also like to ask you to change the commit message's title to |
Done |
One more thing I noticed too late - you need to add a changelog entry. |
Done |
And the build failed again. |
Whoops, my bad. Should work now. |
This has to be rebased on top of the current |
Done |
🎆 |
Without STDIN support, text editor plugins have to create tmp files to implement lint-as-you-type because the actual file is not saved yet. This is far from ideal, and this PR aims to fix that. Here's example usage:
The file path is still used for things like source file name linting, but the raw source comes from STDIN.