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

While passing file through STDIN we should lint just that #501

Merged
merged 1 commit into from
Nov 19, 2024
Merged
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
10 changes: 4 additions & 6 deletions src/ameba/config.cr
Original file line number Diff line number Diff line change
Expand Up @@ -164,14 +164,12 @@ class Ameba::Config
# config.sources # => list of sources pointing to files found by the wildcards
# ```
def sources
srcs = (find_files_by_globs(globs) - find_files_by_globs(excluded))
.map { |path| Source.new File.read(path), path }

if file = stdin_filename
srcs << Source.new(STDIN.gets_to_end, file)
[Source.new(STDIN.gets_to_end, file)]
else
(find_files_by_globs(globs) - find_files_by_globs(excluded))
.map { |path| Source.new File.read(path), path }
end

srcs
end

# Returns a formatter to be used while inspecting files.
Expand Down