Skip to content

Commit

Permalink
Merge pull request #2374 from Br3nda/bw/user-name-tmp-dirs
Browse files Browse the repository at this point in the history
Add $username to default /tmp folder path
  • Loading branch information
bbatsov committed Nov 2, 2015
2 parents d196236 + 88dc507 commit 10b6092
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
* [#1981](https://github.com/bbatsov/rubocop/issues/1981): `Lint/UselessAssignment` doesn't erroneously identify assignments in identical if branches as useless. ([@alexdowad][])
* [#2323](https://github.com/bbatsov/rubocop/issues/2323): `Style/IfUnlessModifier` cop parenthesizes autocorrected code when necessary due to operator precedence, to avoid changing its meaning. ([@alexdowad][])
* [#2003](https://github.com/bbatsov/rubocop/issues/2003): Make `Lint/UnneededDisable` work with `--auto-correct`. ([@jonas054][])
* Default RuboCop cache dir moved to per-user folders. ([@br3nda][])

## 0.34.2 (21/09/2015)

Expand Down Expand Up @@ -1692,3 +1693,4 @@
[@minustehbare]: https://github.com/minustehbare
[@tansaku]: https://github.com/tansaku
[@ptrippett]: https://github.com/ptrippett
[@br3nda]: https://github.com/br3nda
3 changes: 2 additions & 1 deletion lib/rubocop/result_cache.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
require 'digest/md5'
require 'find'
require 'tmpdir'
require 'etc'

module RuboCop
# Provides functionality for caching rubocop runs.
Expand Down Expand Up @@ -78,7 +79,7 @@ def self.cleanup(config_store, verbose, cache_root = nil)

def self.cache_root(config_store)
root = config_store.for('.')['AllCops']['CacheRootDirectory']
root = Dir.tmpdir if root == '/tmp'
root = File.join(Dir.tmpdir, Etc.getlogin) if root == '/tmp'
File.join(root, 'rubocop_cache')
end

Expand Down

0 comments on commit 10b6092

Please sign in to comment.