Skip to content

Commit

Permalink
style: format code with Autopep8, Black, ClangFormat, dotnet-format, …
Browse files Browse the repository at this point in the history
…Go fmt, Gofumpt, Google Java Format, isort, PHP CS Fixer, Prettier, RuboCop, Ruff Formatter, Rustfmt, Scalafmt, StandardJS, StandardRB, swift-format and Yapf

This commit fixes the style issues introduced in 1523183 according to the output
from Autopep8, Black, ClangFormat, dotnet-format, Go fmt, Gofumpt, Google Java
Format, isort, PHP CS Fixer, Prettier, RuboCop, Ruff Formatter, Rustfmt,
Scalafmt, StandardJS, StandardRB, swift-format and Yapf.

Details: None
  • Loading branch information
deepsource-autofix[bot] authored Nov 28, 2024
1 parent 1523183 commit 23eb656
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Python/Anaconda/Apple/m4/clean_yaml.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
import yaml

# Load the YAML file
with open('x.yaml', 'r') as f:
with open("x.yaml", "r") as f:
data = yaml.safe_load(f)

# Process dependencies, handling both strings and dictionaries
new_dependencies = []
for item in data['dependencies']:
for item in data["dependencies"]:
if isinstance(item, str):
package_name = item.split('=')[0]
package_name = item.split("=")[0]
new_dependencies.append(package_name)
elif isinstance(item, dict):
# Assuming each dictionary has one key-value pair
package_name = list(item.keys())[0].split('=')[0]
package_name = list(item.keys())[0].split("=")[0]
new_dependencies.append(package_name)

# Update the dependencies in the data
data['dependencies'] = new_dependencies
data["dependencies"] = new_dependencies

# Write the modified data back to the YAML file
with open('x.yaml', 'w') as f:
with open("x.yaml", "w") as f:
yaml.dump(data, f, indent=2) # Added indent for better readability

0 comments on commit 23eb656

Please sign in to comment.