Resolved an issue where the `--project-dir` flag did not function correctly with the check and debug commands // Resolve #5029

This commit is contained in:
Ivan Kravets
2024-12-13 13:01:40 +02:00
parent 1d4b5c8051
commit d15314689d
3 changed files with 7 additions and 7 deletions

View File

@@ -25,6 +25,7 @@ test-driven methodologies, and modern toolchains for unrivaled success.
* Ensured that dependencies of private libraries are no longer unnecessarily re-installed, optimizing dependency management and reducing redundant operations (`issue #4987 <https://github.com/platformio/platformio-core/issues/4987>`_) * Ensured that dependencies of private libraries are no longer unnecessarily re-installed, optimizing dependency management and reducing redundant operations (`issue #4987 <https://github.com/platformio/platformio-core/issues/4987>`_)
* Resolved an issue where the ``compiledb`` target failed to properly escape compiler executable paths containing spaces (`issue #4998 <https://github.com/platformio/platformio-core/issues/4998>`_) * Resolved an issue where the ``compiledb`` target failed to properly escape compiler executable paths containing spaces (`issue #4998 <https://github.com/platformio/platformio-core/issues/4998>`_)
* Resolved an issue with incorrect path resolution when linking static libraries via the `build_flags <https://docs.platformio.org/en/latest/projectconf/sections/env/options/build/build_flags.html>`__ option (`issue #5004 <https://github.com/platformio/platformio-core/issues/5004>`_) * Resolved an issue with incorrect path resolution when linking static libraries via the `build_flags <https://docs.platformio.org/en/latest/projectconf/sections/env/options/build/build_flags.html>`__ option (`issue #5004 <https://github.com/platformio/platformio-core/issues/5004>`_)
* Resolved an issue where the ``--project-dir`` flag did not function correctly with the `pio check <https://docs.platformio.org/en/latest/core/userguide/cmd_check.html>`__ and `pio debug <https://docs.platformio.org/en/latest/core/userguide/cmd_debug.html>`__ commands (`issue #5029 <https://github.com/platformio/platformio-core/issues/5029>`_)
6.1.16 (2024-09-26) 6.1.16 (2024-09-26)
~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~

View File

@@ -19,7 +19,6 @@ import json
import os import os
import shutil import shutil
from collections import Counter from collections import Counter
from os.path import dirname, isfile
from time import time from time import time
import click import click
@@ -77,7 +76,7 @@ def cli( # pylint: disable=too-many-positional-arguments
app.set_session_var("custom_project_conf", project_conf) app.set_session_var("custom_project_conf", project_conf)
# find project directory on upper level # find project directory on upper level
if isfile(project_dir): if os.path.isfile(project_dir):
project_dir = find_project_dir_above(project_dir) project_dir = find_project_dir_above(project_dir)
results = [] results = []
@@ -150,7 +149,7 @@ def cli( # pylint: disable=too-many-positional-arguments
print_processing_header(tool, envname, env_dump) print_processing_header(tool, envname, env_dump)
ct = CheckToolFactory.new( ct = CheckToolFactory.new(
tool, project_dir, config, envname, tool_options tool, os.getcwd(), config, envname, tool_options
) )
result = {"env": envname, "tool": tool, "duration": time()} result = {"env": envname, "tool": tool, "duration": time()}
@@ -250,12 +249,12 @@ def collect_component_stats(result):
components[component].update({DefectItem.SEVERITY_LABELS[defect.severity]: 1}) components[component].update({DefectItem.SEVERITY_LABELS[defect.severity]: 1})
for defect in result.get("defects", []): for defect in result.get("defects", []):
component = dirname(defect.file) or defect.file component = os.path.dirname(defect.file) or defect.file
_append_defect(component, defect) _append_defect(component, defect)
if component.lower().startswith(get_project_dir().lower()): if component.lower().startswith(get_project_dir().lower()):
while os.sep in component: while os.sep in component:
component = dirname(component) component = os.path.dirname(component)
_append_defect(component, defect) _append_defect(component, defect)
return components return components

View File

@@ -86,7 +86,7 @@ def cli( # pylint: disable=too-many-positional-arguments
if not interface: if not interface:
return helpers.predebug_project( return helpers.predebug_project(
ctx, project_dir, project_config, env_name, False, verbose ctx, os.getcwd(), project_config, env_name, False, verbose
) )
configure_args = ( configure_args = (
@@ -106,7 +106,7 @@ def cli( # pylint: disable=too-many-positional-arguments
else: else:
debug_config = _configure(*configure_args) debug_config = _configure(*configure_args)
_run(project_dir, debug_config, client_extra_args) _run(os.getcwd(), debug_config, client_extra_args)
return None return None