Skip to content

Commit

Permalink
Updated the logic for setting the filepath to be more permissive
Browse files Browse the repository at this point in the history
  • Loading branch information
sushimon committed Jun 28, 2023
1 parent b4e213c commit 250d7b0
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions python_ta/reporters/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,16 +219,9 @@ def on_set_current_module(self, module: str, filepath: Optional[str]) -> None:
# First, check if `module` is the name of a config file and if so, make filepath the
# corresponding path to that config file.
possible_config_path = Path(os.path.expandvars(module)).expanduser()
config_extensions = [".toml", ".ini", ".pylintrc"]

if possible_config_path.exists():
module_basename = os.path.basename(module)
if (
any(possible_config_path.suffix == extension for extension in config_extensions)
or module_basename == ".pylintrc"
or module_basename == "pylintrc"
):
filepath = possible_config_path

if possible_config_path.exists() and filepath is None:
filepath = possible_config_path

# Skip if filepath is None
if filepath is None:
Expand Down

0 comments on commit 250d7b0

Please sign in to comment.