File tree Expand file tree Collapse file tree 3 files changed +23
-19
lines changed Expand file tree Collapse file tree 3 files changed +23
-19
lines changed Original file line number Diff line number Diff line change 16
16
DEFAULT_RULESDIR ,
17
17
INVALID_CONFIG_RC ,
18
18
)
19
- from ansiblelint .file_utils import expand_path_vars , guess_project_dir , normpath
19
+ from ansiblelint .file_utils import (
20
+ abspath ,
21
+ expand_path_vars ,
22
+ guess_project_dir ,
23
+ normpath ,
24
+ )
20
25
21
26
_logger = logging .getLogger (__name__ )
22
27
_PATH_VARS = [
25
30
]
26
31
27
32
28
- def abspath (path : str , base_dir : str ) -> str :
29
- """Make relative path absolute relative to given directory.
30
-
31
- Args:
32
- path (str): the path to make absolute
33
- base_dir (str): the directory from which make \
34
- relative paths absolute
35
- """
36
- if not os .path .isabs (path ):
37
- # Don't use abspath as it assumes path is relative to cwd.
38
- # We want it relative to base_dir.
39
- path = os .path .join (base_dir , path )
40
-
41
- return os .path .normpath (path )
42
-
43
-
44
33
def expand_to_normalized_paths (
45
34
config : Dict [str , Any ], base_dir : Optional [str ] = None
46
35
) -> None :
Original file line number Diff line number Diff line change 28
28
_logger = logging .getLogger (__package__ )
29
29
30
30
31
+ def abspath (path : str , base_dir : str ) -> str :
32
+ """Make relative path absolute relative to given directory.
33
+
34
+ Args:
35
+ path (str): the path to make absolute
36
+ base_dir (str): the directory from which make \
37
+ relative paths absolute
38
+ """
39
+ if not os .path .isabs (path ):
40
+ # Don't use abspath as it assumes path is relative to cwd.
41
+ # We want it relative to base_dir.
42
+ path = os .path .join (base_dir , path )
43
+
44
+ return os .path .normpath (path )
45
+
46
+
31
47
def normpath (path : Union [str , BasePathLike ]) -> str :
32
48
"""
33
49
Normalize a path in order to provide a more consistent output.
Original file line number Diff line number Diff line change 23
23
import pytest
24
24
25
25
from ansiblelint import formatters
26
- from ansiblelint .cli import abspath
27
- from ansiblelint .file_utils import Lintable
26
+ from ansiblelint .file_utils import Lintable , abspath
28
27
from ansiblelint .rules import RulesCollection
29
28
from ansiblelint .runner import Runner
30
29
You can’t perform that action at this time.
0 commit comments