-
Notifications
You must be signed in to change notification settings - Fork 6.1k
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: kconfig: lint.py: Improve error reporting #21577
Merged
nashif
merged 1 commit into
zephyrproject-rtos:master
from
ulfalizer:lint-error-reporting
Jan 9, 2020
Merged
scripts: kconfig: lint.py: Improve error reporting #21577
nashif
merged 1 commit into
zephyrproject-rtos:master
from
ulfalizer:lint-error-reporting
Jan 9, 2020
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ulfalizer
force-pushed
the
lint-error-reporting
branch
from
December 23, 2019 12:42
3f7f1fc
to
d510843
Compare
ulfalizer
added a commit
to ulfalizer/ci-tools
that referenced
this pull request
Dec 23, 2019
Similar improvements to zephyrproject-rtos/zephyr#21577. No custom potentially-missing working directory is used here, but always including the exception message still feels more robust. Use err() instead of sys.exit() in git(), and have it include the command name, which is helpful in logs. Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
ulfalizer
force-pushed
the
lint-error-reporting
branch
from
December 23, 2019 13:34
d510843
to
bccc356
Compare
ulfalizer
added a commit
to ulfalizer/ci-tools
that referenced
this pull request
Dec 31, 2019
Similar improvements to zephyrproject-rtos/zephyr#21577. No custom potentially-missing working directory is used here, but always including the exception message still feels more robust. Use err() instead of sys.exit() in git(), and have it include the command name, which is helpful in logs. Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
nashif
pushed a commit
to zephyrproject-rtos/ci-tools
that referenced
this pull request
Jan 2, 2020
Similar improvements to zephyrproject-rtos/zephyr#21577. No custom potentially-missing working directory is used here, but always including the exception message still feels more robust. Use err() instead of sys.exit() in git(), and have it include the command name, which is helpful in logs. Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
ulfalizer
force-pushed
the
lint-error-reporting
branch
from
January 3, 2020 01:47
bccc356
to
cba702d
Compare
ulfalizer
force-pushed
the
lint-error-reporting
branch
from
January 9, 2020 05:23
cba702d
to
bdeea65
Compare
carlescufi
approved these changes
Jan 9, 2020
@ulfalizer please rebase |
If the working directory for a command was missing (usually due to forgetting to run 'west update'), you'd get a FileNotFoundError exception along with a cryptic error like 'git' not found Only catch OSError instead (which is a base class of FileNotFoundError), and always show the exception message. It makes it clear that it's the working directory that's missing. Add some other misc. improvements too: - Turn stderr output from external commands into a warning instead of an error - Add err() and warn() helpers - Include the command name in messages Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
ulfalizer
force-pushed
the
lint-error-reporting
branch
from
January 9, 2020 13:47
bdeea65
to
f5a7eec
Compare
Rebased. Think it was just a random failure. |
ulfalizer
added a commit
to ulfalizer/zephyr
that referenced
this pull request
Jan 10, 2020
Gets these commits in: check_compliance.py: Detect refs to undef. symbols in samples and tests Extend the check for references to undefined Kconfig symbols to also detect undefined symbols in samples and tests. Samples and tests were skipped due to using separate Kconfig trees, which hid the symbols defined in them. Work around it by grepping for Kconfig symbol definitions in them instead. Keep properly parsing the main Kconfig tree, as it's needed to see symbol names that are stitched together with the Kconfig preprocessor. ------------------------------------------------------------------ check_compliance.py: Detect bad header comments and other nits Add a generic kitchen-sink Nits test for various minor nits that aren't already covered by tools like checkpatch.pl and pylint. So far checks this: - Header comments in Kconfig files - Missing newlines at the end of various source files (probably a bad editor setting) - Leading/trailing blank lines in files ------------------------------------------------------------------ check_compliance.py: Kconfig: Flag redundant $ZEPHYR_BASE in 'source' 'source's like source "$(ZEPHYR_BASE)/Kconfig.zephyr" can be simplified to source "Kconfig.zephyr" since $srctree already points to the Zephyr root. Flag it in the Nits test. This also avoids absolute paths showing up in some places. ------------------------------------------------------------------ check_compliance.py: Improve error reporting for Git commands Similar improvements to zephyrproject-rtos#21577. No custom potentially-missing working directory is used here, but always including the exception message still feels more robust. Use err() instead of sys.exit() in git(), and have it include the command name, which is helpful in logs. Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
nashif
pushed a commit
that referenced
this pull request
Jan 10, 2020
Gets these commits in: check_compliance.py: Detect refs to undef. symbols in samples and tests Extend the check for references to undefined Kconfig symbols to also detect undefined symbols in samples and tests. Samples and tests were skipped due to using separate Kconfig trees, which hid the symbols defined in them. Work around it by grepping for Kconfig symbol definitions in them instead. Keep properly parsing the main Kconfig tree, as it's needed to see symbol names that are stitched together with the Kconfig preprocessor. ------------------------------------------------------------------ check_compliance.py: Detect bad header comments and other nits Add a generic kitchen-sink Nits test for various minor nits that aren't already covered by tools like checkpatch.pl and pylint. So far checks this: - Header comments in Kconfig files - Missing newlines at the end of various source files (probably a bad editor setting) - Leading/trailing blank lines in files ------------------------------------------------------------------ check_compliance.py: Kconfig: Flag redundant $ZEPHYR_BASE in 'source' 'source's like source "$(ZEPHYR_BASE)/Kconfig.zephyr" can be simplified to source "Kconfig.zephyr" since $srctree already points to the Zephyr root. Flag it in the Nits test. This also avoids absolute paths showing up in some places. ------------------------------------------------------------------ check_compliance.py: Improve error reporting for Git commands Similar improvements to #21577. No custom potentially-missing working directory is used here, but always including the exception message still feels more robust. Use err() instead of sys.exit() in git(), and have it include the command name, which is helpful in logs. Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
If the working directory for a command was missing (usually due to
forgetting to run 'west update'), you'd get a FileNotFoundError
exception along with a cryptic error like
Only catch OSError instead (which is a base class of FileNotFoundError),
and always show the exception message. It makes it clear that it's the
working directory that's missing.
Add some other misc. improvements too:
Turn stderr output from external commands into a warning instead of
an error
Add err() and warn() helpers
Include the command name in messages