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

Ruff format #388

Merged
merged 3 commits into from
Dec 21, 2024
Merged

Ruff format #388

merged 3 commits into from
Dec 21, 2024

Conversation

GeoDerp
Copy link
Contributor

@GeoDerp GeoDerp commented Nov 28, 2024

This PR is a predecessor of: #387
(feel free to pull this one and close 387)

  • Enabled Ruff to auto format python files on save in dev container
  • Formatted EMHASS with Ruff

Comment on lines +342 to +345
"The CSV file "
+ csv_file
+ " was not found in path: "
+ str(emhass_conf["data_path"])

Check failure

Code scanning / CodeQL

Clear-text logging of sensitive information High

This expression logs
sensitive data (secret)
as clear text.
This expression logs
sensitive data (secret)
as clear text.
This expression logs
sensitive data (secret)
as clear text.
This expression logs
sensitive data (secret)
as clear text.
This expression logs
sensitive data (secret)
as clear text.
This expression logs
sensitive data (private)
as clear text.
This expression logs
sensitive data (private)
as clear text.
This expression logs
sensitive data (secret)
as clear text.
This expression logs
sensitive data (secret)
as clear text.
This expression logs
sensitive data (secret)
as clear text.
Comment on lines +1049 to +1050
"No saved entity json files that match prefix: "
+ str(publish_prefix)

Check failure

Code scanning / CodeQL

Clear-text logging of sensitive information High

This expression logs
sensitive data (secret)
as clear text.
This expression logs
sensitive data (secret)
as clear text.
This expression logs
sensitive data (secret)
as clear text.
This expression logs
sensitive data (secret)
as clear text.
This expression logs
sensitive data (secret)
as clear text.
This expression logs
sensitive data (private)
as clear text.
This expression logs
sensitive data (private)
as clear text.
@@ -1010,7 +1250,7 @@
type_var="cost_fun",
publish_prefix=publish_prefix,
save_entities=entity_save,
dont_post=dont_post
dont_post=dont_post,

Check failure

Code scanning / CodeQL

Clear-text logging of sensitive information High

This expression logs
sensitive data (secret)
as clear text.
This expression logs
sensitive data (secret)
as clear text.
This expression logs
sensitive data (secret)
as clear text.
Comment on lines +278 to +279
with emhass_conf["associations_path"].open("r") as data:
associations = list(csv.reader(data, delimiter=","))

Check failure

Code scanning / CodeQL

Clear-text logging of sensitive information High

This expression logs
sensitive data (secret)
as clear text.
This expression logs
sensitive data (secret)
as clear text.
This expression logs
sensitive data (secret)
as clear text.
This expression logs
sensitive data (secret)
as clear text.
This expression logs
sensitive data (secret)
as clear text.
This expression logs
sensitive data (private)
as clear text.
This expression logs
sensitive data (private)
as clear text.
Comment on lines +1008 to +1009
"Cant find associations file (associations.csv) in: "
+ str(emhass_conf["associations_path"])

Check failure

Code scanning / CodeQL

Clear-text logging of sensitive information High

This expression logs
sensitive data (secret)
as clear text.
This expression logs
sensitive data (secret)
as clear text.
This expression logs
sensitive data (secret)
as clear text.
This expression logs
sensitive data (secret)
as clear text.
This expression logs
sensitive data (private)
as clear text.
This expression logs
sensitive data (private)
as clear text.
This expression logs
sensitive data (secret)
as clear text.
app.logger.warning("Unable to find data_path: " + str(emhass_conf['data_path']))
# Check if data path exists
if not os.path.isdir(emhass_conf["data_path"]):
app.logger.warning("Unable to find data_path: " + str(emhass_conf["data_path"]))

Check failure

Code scanning / CodeQL

Clear-text logging of sensitive information High

This expression logs
sensitive data (secret)
as clear text.
This expression logs
sensitive data (secret)
as clear text.
This expression logs
sensitive data (secret)
as clear text.
This expression logs
sensitive data (secret)
as clear text.
This expression logs
sensitive data (private)
as clear text.
This expression logs
sensitive data (private)
as clear text.
This expression logs
sensitive data (secret)
as clear text.
This expression logs
sensitive data (secret)
as clear text.
This expression logs
sensitive data (secret)
as clear text.
app.logger.info("data_path has been set to " + str(emhass_conf['data_path']))
Path(root_path / "data/").mkdir(parents=True, exist_ok=True)
emhass_conf["data_path"] = root_path / "data/"
app.logger.info("data_path has been set to " + str(emhass_conf["data_path"]))

Check failure

Code scanning / CodeQL

Clear-text logging of sensitive information High

This expression logs
sensitive data (secret)
as clear text.
This expression logs
sensitive data (secret)
as clear text.
This expression logs
sensitive data (secret)
as clear text.
This expression logs
sensitive data (secret)
as clear text.
This expression logs
sensitive data (private)
as clear text.
This expression logs
sensitive data (private)
as clear text.
This expression logs
sensitive data (secret)
as clear text.
This expression logs
sensitive data (secret)
as clear text.
This expression logs
sensitive data (secret)
as clear text.
app.logger.info("The logging is: "+str(logging_level))
port = int(os.environ.get("PORT", 5000))
app.logger.info(
"Launching the emhass webserver at: http://" + server_ip + ":" + str(port)

Check failure

Code scanning / CodeQL

Clear-text logging of sensitive information High

This expression logs
sensitive data (secret)
as clear text.
This expression logs
sensitive data (secret)
as clear text.
Comment on lines +707 to +708
"Home Assistant data fetch will be performed using url: "
+ params_secrets["hass_url"]

Check failure

Code scanning / CodeQL

Clear-text logging of sensitive information High

This expression logs
sensitive data (secret)
as clear text.
This expression logs
sensitive data (secret)
as clear text.
"Home Assistant data fetch will be performed using url: "
+ params_secrets["hass_url"]
)
app.logger.info("The data path is: " + str(emhass_conf["data_path"]))

Check failure

Code scanning / CodeQL

Clear-text logging of sensitive information High

This expression logs
sensitive data (secret)
as clear text.
This expression logs
sensitive data (secret)
as clear text.
This expression logs
sensitive data (secret)
as clear text.
This expression logs
sensitive data (secret)
as clear text.
This expression logs
sensitive data (private)
as clear text.
This expression logs
sensitive data (private)
as clear text.
This expression logs
sensitive data (secret)
as clear text.
This expression logs
sensitive data (secret)
as clear text.
This expression logs
sensitive data (secret)
as clear text.
@GeoDerp
Copy link
Contributor Author

GeoDerp commented Nov 28, 2024

@davidusb-geek this is what the project looks like with ruff auto formatting.

@davidusb-geek
Copy link
Owner

This PR is a predecessor of: #387 (feel free to pull this one and close 387)

  • Enabled Ruff to auto format python files on save in dev container
  • Formatted EMHASS with Ruff

So all the changes that you made on #387 are included here right?

@davidusb-geek
Copy link
Owner

@GeoDerp, I tried to merge the latest changes from master. Almost succeded but there is still a little error on some implementations of treat_runtimeparams. As this is in your repository can you please fix the issue and update this PR?
Thanks in advance

@davidusb-geek davidusb-geek merged commit 3d0a4af into davidusb-geek:master Dec 21, 2024
10 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants