diff options
author | Stan Hu <stanhu@gmail.com> | 2019-05-03 15:41:47 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2019-05-03 15:44:46 +0300 |
commit | a8cbec49a09fc82f5d6b0a74f06858b667f39a56 (patch) | |
tree | 433fa13eae164f0c8b69be2aba27d2d533d981a5 /rubocop/qa_helpers.rb | |
parent | 9f8123d935679582ac4f1487e1dcb559863372cb (diff) |
Cache current working directory to speed up Rubocop
This saves thousands of getcwd() system calls and improves the
performance of running Rubocop, which is also used by HAML linting.
Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/61383
Diffstat (limited to 'rubocop/qa_helpers.rb')
-rw-r--r-- | rubocop/qa_helpers.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/rubocop/qa_helpers.rb b/rubocop/qa_helpers.rb index f4adf7f4e9f..95875d64727 100644 --- a/rubocop/qa_helpers.rb +++ b/rubocop/qa_helpers.rb @@ -5,7 +5,7 @@ module RuboCop def in_qa_file?(node) path = node.location.expression.source_buffer.name - path.start_with?(File.join(Dir.pwd, 'qa')) + path.start_with?(File.join(RuboCop::PathUtil.pwd, 'qa')) end end end |