Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scripts: ci: check_compliance: fix split on ":" for Windows #69587

Merged
merged 1 commit into from
Feb 29, 2024
Merged

scripts: ci: check_compliance: fix split on ":" for Windows #69587

merged 1 commit into from
Feb 29, 2024

Conversation

yvanderv
Copy link
Contributor

The method get_kconfig_dts() relies on str's split() to split lines into fields separated by ':'. The second field is an absolute path to a file.
On Windows, an absolute path includes a drive's letter followed by ':' which breaks the current code.
On Linux, although rare, a file or directory name may also include ':', which would also break the code.

The fix is to constraint the number of splits to 1. The code then becomes:

_,b = line.split(":", 1)

The method get_kconfig_dts() relies on str's split() to split
lines into fields separated by ':'. The second field is an
absolute path to a file.
On Windows, an absolute path includes a drive's letter followed
by ':' which breaks the current code.
On Linux, although rare, a file or directory name may also include
':', which would also break the code.

The fix is to constraint the number of splits to 1.
The code then becomes:

 _,b = line.split(":", 1)

Signed-off-by: Yves Vandervennet <[email protected]>
@zephyrbot zephyrbot added Trivial Changes that can be reviewed by anyone, i.e. doc changes, minor build system tweaks, etc. area: Continuous Integration area: Coding Guidelines Coding guidelines and style labels Feb 28, 2024
@nashif nashif merged commit 4f34a41 into zephyrproject-rtos:main Feb 29, 2024
28 checks passed
@yvanderv yvanderv deleted the fix-check_compliance_windows branch February 29, 2024 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Coding Guidelines Coding guidelines and style area: Continuous Integration Trivial Changes that can be reviewed by anyone, i.e. doc changes, minor build system tweaks, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants