Commit 6e515cdd authored by Alex Kalderimis's avatar Alex Kalderimis

Improve code-quality in Queries.find

parent 0f7c3b70
...@@ -164,11 +164,7 @@ module Gitlab ...@@ -164,11 +164,7 @@ module Gitlab
definitions = [] definitions = []
::Find.find(root.to_s) do |path| ::Find.find(root.to_s) do |path|
next unless path.ends_with?('.graphql') definitions << Definition.new(path, fragments) if query?(path)
next if path.ends_with?('.fragment.graphql')
next if path.ends_with?('typedefs.graphql')
definitions << Definition.new(path, fragments)
end end
definitions definitions
...@@ -191,6 +187,12 @@ module Gitlab ...@@ -191,6 +187,12 @@ module Gitlab
@known_failures.fetch('filenames', []).any? { |known_failure| path.to_s.ends_with?(known_failure) } @known_failures.fetch('filenames', []).any? { |known_failure| path.to_s.ends_with?(known_failure) }
end end
def self.query?(path)
path.ends_with?('.graphql') &&
!path.ends_with?('.fragment.graphql') &&
!path.ends_with?('typedefs.graphql')
end
end end
end end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment