-
Notifications
You must be signed in to change notification settings - Fork 44
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
Add GitHub actions #320
Merged
Merged
Add GitHub actions #320
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
This was
linked to
issues
Jul 15, 2021
8c99997
to
fd764f4
Compare
LDong-Arm
previously approved these changes
Jul 15, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
eb50a56
to
730b75a
Compare
We passed the package name `greentea` to setuptools to discover the current package version. This failed because the package name is actually `mbed-greentea`.
730b75a
to
a6eb618
Compare
Ignore "imported but unused" warnings for __init__.py files as it's a common pattern to use __init__.py to export the public API of a package. Ignore directories we don't want flake8 to traverse. Ignore docstring errors in the host tests. Docstrings in test classes are less important than docstrings in production code.
39e2446
to
1f93028
Compare
Patater
suggested changes
Jul 16, 2021
1f93028
to
f95b032
Compare
dd176de
to
d60a8cf
Compare
Patater
suggested changes
Jul 22, 2021
Convert the docstrings to google style and fix the flake8 errors.
Remove unused imports flagged by flake8.
Simplify the logic and remove an unused variable.
Previously we tried to print an undefined variable during exception handling. We used a bare `except` statement which would suppress all possible exceptions including SystemExit and KeyboardInterrupt, print an "Unexpected error" message and forward the exception further up the stack. This does not seem like desirable behaviour, when a user hits CTRL-C they probably don't need to see an "Unexpected error" message in the log. Instead we now catch any exceptions derived from `Exception` (still not ideal) and print the error message from it. In another case we defined a local variable for an exception but it wasn't used, so remove it.
Use raw strings which treat backslashes as literal characters to pass to the re module.
Catch the "base" non-interpreter exception instead of using bare except. We need to rework the error handling to only handle errors we care about. Instead of trying to trap all possible errors, which is an antipattern in exception based error handling.
Checking True or False by value makes no sense, they are not values. Instead we should check if we have an "instance" of the True or False objects.
The workflow contains two matrices to run on PRs: - lint: code formatting and static analysis - test: unit tests and code coverage
d60a8cf
to
bbb4119
Compare
Patater
approved these changes
Jul 22, 2021
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.
Add a github actions workflow.
Fix flake8 errors with docstrings and exceptions.
Modify flake8 config:
__init__.py
files