-
Notifications
You must be signed in to change notification settings - Fork 0
test #51
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
test #51
Conversation
👋 Hello lucasssvaz, we appreciate your contribution to this project! 📘 Please review the project's Contributions Guide for key guidelines on code, documentation, testing, and more. 🖊️ Please also make sure you have read and signed the Contributor License Agreement for this project. Click to see more instructions ...
Review and merge process you can expect ...
|
Memory usage test (comparing PR against master branch)The table below shows the summary of memory usage change (decrease - increase) in bytes and percentage for each target.
Click to expand the detailed deltas report [usage change in BYTES]
|
b45a824
to
be346a4
Compare
@@ -15,9 +15,13 @@ | |||
import json | |||
import sys | |||
|
|||
def load_file(filename): | |||
f = open(filename, "r") |
Check warning
Code scanning / CodeQL
File is not always closed Warning
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 4 days ago
The best way to fix this problem is to ensure that the file is always closed, even if an exception occurs. The most Pythonic and robust way to do this is to use a with
statement when opening the file. This ensures that the file is closed automatically when the block is exited, regardless of whether an exception is raised. Specifically, in .github/scripts/merge_packages.py
, the function load_file(filename)
should be modified so that the file is opened using a with
statement, and the file's contents are read within that block. No additional imports or method definitions are needed.
-
Copy modified lines R19-R20
@@ -18,4 +18,4 @@ | ||
def load_file(filename): | ||
f = open(filename, "r") | ||
pkg = json.loads(f.read())["packages"][0] | ||
with open(filename, "r") as f: | ||
pkg = json.loads(f.read())["packages"][0] | ||
return pkg |
By completing this PR sufficiently, you help us to review this Pull Request quicker and also help improve the quality of Release Notes
Checklist
This entire section above can be deleted if all items are checked.
Description of Change
Please describe your proposed Pull Request and it's impact.
Tests scenarios
Please describe on what Hardware and Software combinations you have tested this Pull Request and how.
(eg. I have tested my Pull Request on Arduino-esp32 core v2.0.2 with ESP32 and ESP32-S2 Board with this scenario)
Related links
Please provide links to related issue, PRs etc.
(eg. Closes #number of issue)