Skip to content

Commit

Permalink
[#447] Fixed issue where --with-tool would reset the list of tools to…
Browse files Browse the repository at this point in the history
… run to defaults, instead of using values in profiles
  • Loading branch information
carlio committed Feb 26, 2022
1 parent 7fde974 commit ac10819
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ Version 1.7.1 - WIP
**Fixes**:

* Prospector now configures pylint using settings found in `pyproject.toml` or `setup.cfg`, not only `.pylintrc` - `#485 <https://github.com/PyCQA/prospector/issues/485>_`
* Fixed `--no-style-warnings` command line argument no longer warning after renaming `pep8` to `pycodestyle` - `#488 <https://github.com/PyCQA/prospector/issues/488>_`
* Fixed `--no-style-warnings` command line argument no longer warning after renaming `pep8` to `pycodestyle` - `#488 <https://github.com/PyCQA/prospector/issues/488>_`
* Documentation is building again - `#473 <https://github.com/PyCQA/prospector/issues/473>_`
* `--with-tool` flag now respects - but overrides - tools disabled in profiles - `#447 <https://github.com/PyCQA/prospector/issues/447>_`


Version 1.7.0
Expand Down
16 changes: 9 additions & 7 deletions prospector/config/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,13 +212,15 @@ def _determine_tool_runners(self, config, profile):
if tool in to_run:
to_run.remove(tool)

if config.tools is None and len(config.with_tools) == 0 and len(config.without_tools) == 0:
for tool in tools.TOOLS.keys():
enabled = profile.is_tool_enabled(tool)
if enabled is None:
enabled = tool in DEFAULT_TOOLS
if tool in to_run and not enabled:
to_run.remove(tool)
# if config.tools is None and len(config.with_tools) == 0 and len(config.without_tools) == 0:
for tool in tools.TOOLS.keys():
enabled = profile.is_tool_enabled(tool)
if enabled is None:
enabled = tool in DEFAULT_TOOLS
if tool in to_run and not enabled and tool not in config.with_tools and tool not in (config.tools or []):
# if this is not enabled in a profile but is asked for in a command line arg, we keep it, otherwise
# remove it from the list to run
to_run.remove(tool)

return sorted(list(to_run))

Expand Down

0 comments on commit ac10819

Please sign in to comment.