Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion platformio/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@


def projects_dir_validate(projects_dir):
assert os.path.isdir(projects_dir)
if not os.path.isdir(projects_dir):
raise ValueError(projects_dir)
Copy link

Copilot AI Mar 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a regression test for this validator that runs under Python optimized mode (-O) to ensure config validation still rejects a non-existent projects_dir when asserts are stripped (e.g., spawn a subprocess with sys.executable and -O and assert it exits with InvalidSettingValue). This prevents future refactors from reintroducing assert-based validation.

Suggested change
raise ValueError(projects_dir)
raise exception.InvalidSettingValue(
"Invalid 'projects_dir' path: %r" % (projects_dir,)
)

Copilot uses AI. Check for mistakes.
return os.path.abspath(projects_dir)


Expand Down
Loading