Skip to content

Commit

Permalink
Merge branch 'main' into fix/dotnet-nuget-config
Browse files Browse the repository at this point in the history
  • Loading branch information
rkm committed Dec 19, 2022
2 parents ac81e9e + b474a83 commit 621bd01
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Expand Up @@ -20,12 +20,12 @@ repos:
exclude: ^(pre_commit/resources/|testing/resources/python3_hooks_repo/)
args: [--py37-plus, --add-import, 'from __future__ import annotations']
- repo: https://github.com/asottile/add-trailing-comma
rev: v2.3.0
rev: v2.4.0
hooks:
- id: add-trailing-comma
args: [--py36-plus]
- repo: https://github.com/asottile/pyupgrade
rev: v3.3.0
rev: v3.3.1
hooks:
- id: pyupgrade
args: [--py37-plus]
Expand Down
3 changes: 2 additions & 1 deletion pre_commit/languages/r.py
Expand Up @@ -15,6 +15,7 @@
from pre_commit.prefix import Prefix
from pre_commit.util import clean_path_on_failure
from pre_commit.util import cmd_output_b
from pre_commit.util import win_exe

ENVIRONMENT_DIR = 'renv'
RSCRIPT_OPTS = ('--no-save', '--no-restore', '--no-site-file', '--no-environ')
Expand Down Expand Up @@ -63,7 +64,7 @@ def _rscript_exec() -> str:
if r_home is None:
return 'Rscript'
else:
return os.path.join(r_home, 'bin', 'Rscript')
return os.path.join(r_home, 'bin', win_exe('Rscript'))


def _entry_validate(entry: Sequence[str]) -> None:
Expand Down
3 changes: 2 additions & 1 deletion tests/languages/r_test.py
Expand Up @@ -6,6 +6,7 @@

from pre_commit import envcontext
from pre_commit.languages import r
from pre_commit.util import win_exe
from testing.fixtures import make_config_from_repo
from testing.fixtures import make_repo
from tests.repository_test import _get_hook_no_install
Expand Down Expand Up @@ -133,7 +134,7 @@ def test_r_parsing_file_local(tempdir_factory, store):


def test_rscript_exec_relative_to_r_home():
expected = os.path.join('r_home_dir', 'bin', 'Rscript')
expected = os.path.join('r_home_dir', 'bin', win_exe('Rscript'))
with envcontext.envcontext((('R_HOME', 'r_home_dir'),)):
assert r._rscript_exec() == expected

Expand Down

0 comments on commit 621bd01

Please sign in to comment.