diff options
author | Douwe Maan <douwe@selenight.nl> | 2017-02-21 17:29:35 -0600 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2017-02-23 09:31:56 -0600 |
commit | 3dadf306ddc81183e74b048bc4119796852ed7ea (patch) | |
tree | f01d5e7eb9c5550bc34a42d9e88479cd3fef578d /lib | |
parent | 547063b3ac096dff25309b6e0846b0d5f417c128 (diff) | |
download | gitlab-ce-3dadf306ddc81183e74b048bc4119796852ed7ea.tar.gz |
Enable Style/DotPosition
Diffstat (limited to 'lib')
-rw-r--r-- | lib/api/merge_requests.rb | 18 | ||||
-rw-r--r-- | lib/api/pipelines.rb | 4 | ||||
-rw-r--r-- | lib/api/v3/merge_requests.rb | 18 | ||||
-rw-r--r-- | lib/banzai/pipeline/wiki_pipeline.rb | 4 | ||||
-rw-r--r-- | lib/banzai/reference_extractor.rb | 4 | ||||
-rw-r--r-- | lib/ci/gitlab_ci_yaml_processor.rb | 4 | ||||
-rw-r--r-- | lib/gitlab/badge/build/status.rb | 6 | ||||
-rw-r--r-- | lib/gitlab/badge/coverage/report.rb | 6 | ||||
-rw-r--r-- | lib/gitlab/bitbucket_import/importer.rb | 8 | ||||
-rw-r--r-- | lib/gitlab/checks/matching_merge_request.rb | 8 | ||||
-rw-r--r-- | lib/gitlab/ci/config/entry/configurable.rb | 10 | ||||
-rw-r--r-- | lib/gitlab/ci/config/entry/global.rb | 6 | ||||
-rw-r--r-- | lib/gitlab/ci/config/entry/jobs.rb | 8 | ||||
-rw-r--r-- | lib/gitlab/ci/status/factory.rb | 8 | ||||
-rw-r--r-- | lib/gitlab/ci/trace_reader.rb | 4 | ||||
-rw-r--r-- | lib/gitlab/git/encoding_helper.rb | 6 | ||||
-rw-r--r-- | lib/gitlab/github_import/importer.rb | 6 | ||||
-rw-r--r-- | lib/gitlab/github_import/user_formatter.rb | 14 |
18 files changed, 71 insertions, 71 deletions
diff --git a/lib/api/merge_requests.rb b/lib/api/merge_requests.rb index bdd764abfeb..6a2476424a7 100644 --- a/lib/api/merge_requests.rb +++ b/lib/api/merge_requests.rb @@ -193,13 +193,13 @@ module API } if params[:merge_when_build_succeeds] && merge_request.head_pipeline && merge_request.head_pipeline.active? - ::MergeRequests::MergeWhenPipelineSucceedsService - .new(merge_request.target_project, current_user, merge_params) - .execute(merge_request) + ::MergeRequests::MergeWhenPipelineSucceedsService. + new(merge_request.target_project, current_user, merge_params). + execute(merge_request) else - ::MergeRequests::MergeService - .new(merge_request.target_project, current_user, merge_params) - .execute(merge_request) + ::MergeRequests::MergeService. + new(merge_request.target_project, current_user, merge_params). + execute(merge_request) end present merge_request, with: Entities::MergeRequest, current_user: current_user, project: user_project @@ -213,9 +213,9 @@ module API unauthorized! unless merge_request.can_cancel_merge_when_build_succeeds?(current_user) - ::MergeRequest::MergeWhenPipelineSucceedsService - .new(merge_request.target_project, current_user) - .cancel(merge_request) + ::MergeRequest::MergeWhenPipelineSucceedsService. + new(merge_request.target_project, current_user). + cancel(merge_request) end desc 'Get the comments of a merge request' do diff --git a/lib/api/pipelines.rb b/lib/api/pipelines.rb index f59f7959173..ffa73696029 100644 --- a/lib/api/pipelines.rb +++ b/lib/api/pipelines.rb @@ -36,8 +36,8 @@ module API new_pipeline = Ci::CreatePipelineService.new(user_project, current_user, - declared_params(include_missing: false)) - .execute(ignore_skip_ci: true, save_on_errors: false) + declared_params(include_missing: false)). + execute(ignore_skip_ci: true, save_on_errors: false) if new_pipeline.persisted? present new_pipeline, with: Entities::Pipeline else diff --git a/lib/api/v3/merge_requests.rb b/lib/api/v3/merge_requests.rb index 129f9d850e9..5a8dacc9c44 100644 --- a/lib/api/v3/merge_requests.rb +++ b/lib/api/v3/merge_requests.rb @@ -200,13 +200,13 @@ module API } if params[:merge_when_build_succeeds] && merge_request.head_pipeline && merge_request.head_pipeline.active? - ::MergeRequests::MergeWhenPipelineSucceedsService - .new(merge_request.target_project, current_user, merge_params) - .execute(merge_request) + ::MergeRequests::MergeWhenPipelineSucceedsService. + new(merge_request.target_project, current_user, merge_params). + execute(merge_request) else - ::MergeRequests::MergeService - .new(merge_request.target_project, current_user, merge_params) - .execute(merge_request) + ::MergeRequests::MergeService. + new(merge_request.target_project, current_user, merge_params). + execute(merge_request) end present merge_request, with: ::API::Entities::MergeRequest, current_user: current_user, project: user_project @@ -220,9 +220,9 @@ module API unauthorized! unless merge_request.can_cancel_merge_when_build_succeeds?(current_user) - ::MergeRequest::MergeWhenPipelineSucceedsService - .new(merge_request.target_project, current_user) - .cancel(merge_request) + ::MergeRequest::MergeWhenPipelineSucceedsService. + new(merge_request.target_project, current_user). + cancel(merge_request) end desc 'Get the comments of a merge request' do diff --git a/lib/banzai/pipeline/wiki_pipeline.rb b/lib/banzai/pipeline/wiki_pipeline.rb index c37b8e71cb0..17b460608d7 100644 --- a/lib/banzai/pipeline/wiki_pipeline.rb +++ b/lib/banzai/pipeline/wiki_pipeline.rb @@ -3,8 +3,8 @@ module Banzai class WikiPipeline < FullPipeline def self.filters @filters ||= begin - super.insert_after(Filter::TableOfContentsFilter, Filter::GollumTagsFilter) - .insert_before(Filter::TaskListFilter, Filter::WikiLinkFilter) + super.insert_after(Filter::TableOfContentsFilter, Filter::GollumTagsFilter). + insert_before(Filter::TaskListFilter, Filter::WikiLinkFilter) end end end diff --git a/lib/banzai/reference_extractor.rb b/lib/banzai/reference_extractor.rb index 8e3b0c4db79..c6426210a92 100644 --- a/lib/banzai/reference_extractor.rb +++ b/lib/banzai/reference_extractor.rb @@ -28,8 +28,8 @@ module Banzai # text blobs to parse. return [] if @texts_and_contexts.empty? - @html_documents ||= Renderer.cache_collection_render(@texts_and_contexts) - .map { |html| Nokogiri::HTML.fragment(html) } + @html_documents ||= Renderer.cache_collection_render(@texts_and_contexts). + map { |html| Nokogiri::HTML.fragment(html) } end end end diff --git a/lib/ci/gitlab_ci_yaml_processor.rb b/lib/ci/gitlab_ci_yaml_processor.rb index 649ee4d018b..04d9756657a 100644 --- a/lib/ci/gitlab_ci_yaml_processor.rb +++ b/lib/ci/gitlab_ci_yaml_processor.rb @@ -115,8 +115,8 @@ module Ci end def yaml_variables(name) - variables = (@variables || {}) - .merge(job_variables(name)) + variables = (@variables || {}). + merge(job_variables(name)) variables.map do |key, value| { key: key.to_s, value: value, public: true } diff --git a/lib/gitlab/badge/build/status.rb b/lib/gitlab/badge/build/status.rb index b762d85b6e5..3c65fd02e4c 100644 --- a/lib/gitlab/badge/build/status.rb +++ b/lib/gitlab/badge/build/status.rb @@ -19,9 +19,9 @@ module Gitlab end def status - @project.pipelines - .where(sha: @sha) - .latest_status(@ref) || 'unknown' + @project.pipelines. + where(sha: @sha). + latest_status(@ref) || 'unknown' end def metadata diff --git a/lib/gitlab/badge/coverage/report.rb b/lib/gitlab/badge/coverage/report.rb index 9a0482306b7..8a6564755ab 100644 --- a/lib/gitlab/badge/coverage/report.rb +++ b/lib/gitlab/badge/coverage/report.rb @@ -42,9 +42,9 @@ module Gitlab if @job.blank? @pipeline.coverage else - @pipeline.builds - .find_by(name: @job) - .try(:coverage) + @pipeline.builds. + find_by(name: @job). + try(:coverage) end end end diff --git a/lib/gitlab/bitbucket_import/importer.rb b/lib/gitlab/bitbucket_import/importer.rb index 44323b47dca..03a7981b1db 100644 --- a/lib/gitlab/bitbucket_import/importer.rb +++ b/lib/gitlab/bitbucket_import/importer.rb @@ -48,10 +48,10 @@ module Gitlab return users[username] if users.key?(username) - users[username] = User.select(:id) - .joins(:identities) - .find_by("identities.extern_uid = ? AND identities.provider = 'bitbucket'", username) - .try(:id) + users[username] = User.select(:id). + joins(:identities). + find_by("identities.extern_uid = ? AND identities.provider = 'bitbucket'", username). + try(:id) end def repo diff --git a/lib/gitlab/checks/matching_merge_request.rb b/lib/gitlab/checks/matching_merge_request.rb index 849848515da..bd295c25194 100644 --- a/lib/gitlab/checks/matching_merge_request.rb +++ b/lib/gitlab/checks/matching_merge_request.rb @@ -8,10 +8,10 @@ module Gitlab end def match? - @project.merge_requests - .with_state(:locked) - .where(in_progress_merge_commit_sha: @newrev, target_branch: @branch_name) - .exists? + @project.merge_requests. + with_state(:locked). + where(in_progress_merge_commit_sha: @newrev, target_branch: @branch_name). + exists? end end end diff --git a/lib/gitlab/ci/config/entry/configurable.rb b/lib/gitlab/ci/config/entry/configurable.rb index e05aca9881b..deaaf06bbd7 100644 --- a/lib/gitlab/ci/config/entry/configurable.rb +++ b/lib/gitlab/ci/config/entry/configurable.rb @@ -27,9 +27,9 @@ module Gitlab return unless valid? self.class.nodes.each do |key, factory| - factory - .value(@config[key]) - .with(key: key, parent: self) + factory. + value(@config[key]). + with(key: key, parent: self) @entries[key] = factory.create! end @@ -49,8 +49,8 @@ module Gitlab private # rubocop:disable Lint/UselessAccessModifier def entry(key, entry, metadata) - factory = Entry::Factory.new(entry) - .with(description: metadata[:description]) + factory = Entry::Factory.new(entry). + with(description: metadata[:description]) (@nodes ||= {}).merge!(key.to_sym => factory) end diff --git a/lib/gitlab/ci/config/entry/global.rb b/lib/gitlab/ci/config/entry/global.rb index a4ec8f0ff2f..8154beea21f 100644 --- a/lib/gitlab/ci/config/entry/global.rb +++ b/lib/gitlab/ci/config/entry/global.rb @@ -46,9 +46,9 @@ module Gitlab private def compose_jobs! - factory = Entry::Factory.new(Entry::Jobs) - .value(@config.except(*self.class.nodes.keys)) - .with(key: :jobs, parent: self, + factory = Entry::Factory.new(Entry::Jobs). + value(@config.except(*self.class.nodes.keys)). + with(key: :jobs, parent: self, description: 'Jobs definition for this pipeline') @entries[:jobs] = factory.create! diff --git a/lib/gitlab/ci/config/entry/jobs.rb b/lib/gitlab/ci/config/entry/jobs.rb index 5671a09480b..41de7dbbb3e 100644 --- a/lib/gitlab/ci/config/entry/jobs.rb +++ b/lib/gitlab/ci/config/entry/jobs.rb @@ -31,10 +31,10 @@ module Gitlab @config.each do |name, config| node = hidden?(name) ? Entry::Hidden : Entry::Job - factory = Entry::Factory.new(node) - .value(config || {}) - .metadata(name: name) - .with(key: name, parent: self, + factory = Entry::Factory.new(node). + value(config || {}). + metadata(name: name). + with(key: name, parent: self, description: "#{name} job definition.") @entries[name] = factory.create! diff --git a/lib/gitlab/ci/status/factory.rb b/lib/gitlab/ci/status/factory.rb index 15836c699c7..efe756cc585 100644 --- a/lib/gitlab/ci/status/factory.rb +++ b/lib/gitlab/ci/status/factory.rb @@ -17,10 +17,10 @@ module Gitlab end def core_status - Gitlab::Ci::Status - .const_get(@status.capitalize) - .new(@subject, @user) - .extend(self.class.common_helpers) + Gitlab::Ci::Status. + const_get(@status.capitalize). + new(@subject, @user). + extend(self.class.common_helpers) end def compound_extended_status diff --git a/lib/gitlab/ci/trace_reader.rb b/lib/gitlab/ci/trace_reader.rb index 1d7ddeb3e0f..dd6a84d7d1c 100644 --- a/lib/gitlab/ci/trace_reader.rb +++ b/lib/gitlab/ci/trace_reader.rb @@ -41,8 +41,8 @@ module Gitlab chunks.unshift(buf) end - chunks.join.lines.last(max_lines).join - .force_encoding(Encoding.default_external) + chunks.join.lines.last(max_lines).join. + force_encoding(Encoding.default_external) end end end diff --git a/lib/gitlab/git/encoding_helper.rb b/lib/gitlab/git/encoding_helper.rb index e57d228e688..874fd8fe6e2 100644 --- a/lib/gitlab/git/encoding_helper.rb +++ b/lib/gitlab/git/encoding_helper.rb @@ -49,9 +49,9 @@ module Gitlab private def clean(message) - message.encode("UTF-16BE", undef: :replace, invalid: :replace, replace: "") - .encode("UTF-8") - .gsub("\0".encode("UTF-8"), "") + message.encode("UTF-16BE", undef: :replace, invalid: :replace, replace: ""). + encode("UTF-8"). + gsub("\0".encode("UTF-8"), "") end end end diff --git a/lib/gitlab/github_import/importer.rb b/lib/gitlab/github_import/importer.rb index d95ff4fd104..a631425b3cf 100644 --- a/lib/gitlab/github_import/importer.rb +++ b/lib/gitlab/github_import/importer.rb @@ -178,9 +178,9 @@ module Gitlab def apply_labels(issuable, raw) return unless raw.labels.count > 0 - label_ids = raw.labels - .map { |attrs| @labels[attrs.name] } - .compact + label_ids = raw.labels. + map { |attrs| @labels[attrs.name] }. + compact issuable.update_attribute(:label_ids, label_ids) end diff --git a/lib/gitlab/github_import/user_formatter.rb b/lib/gitlab/github_import/user_formatter.rb index 04c2964da20..7f3bf0052a7 100644 --- a/lib/gitlab/github_import/user_formatter.rb +++ b/lib/gitlab/github_import/user_formatter.rb @@ -25,8 +25,8 @@ module Gitlab def find_by_email return nil unless email - User.find_by_any_email(email) - .try(:id) + User.find_by_any_email(email). + try(:id) end def find_by_external_uid @@ -34,11 +34,11 @@ module Gitlab identities = ::Identity.arel_table - User.select(:id) - .joins(:identities).where(identities[:provider].eq(:github) - .and(identities[:extern_uid].eq(id))) - .first - .try(:id) + User.select(:id). + joins(:identities).where(identities[:provider].eq(:github). + and(identities[:extern_uid].eq(id))). + first. + try(:id) end end end |