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

Black update #381

Merged
merged 1 commit into from
Jan 29, 2024
Merged

Black update #381

merged 1 commit into from
Jan 29, 2024

Conversation

fnhartmann
Copy link
Collaborator

@fnhartmann fnhartmann commented Jan 29, 2024

The Black Code Formatter was updated in the last few days (23.12.1 -> 24.1.0 -> 24.1.1) and brought some changes. See the release notes.

Our checks are now failing because many files don't match the new formatting:

Run docker run dewolf make check-format
  docker run dewolf make check-format
  shell: /usr/bin/bash -e {0}
make -f Makefile.venv venv
make[1]: Entering directory '/opt/dewolf'
make[1]: Nothing to be done for 'venv'.
make[1]: Leaving directory '/opt/dewolf'
. .venv/bin/activate
python -m black --version && \
python -m black --check . && \
python -m isort --version && \
python -m isort --check . -s install_api.py -s .venv --skip-glob dewolf-idioms --skip-glob logic
python -m black, 24.1.1 (compiled: yes)
Python (CPython) 3.10.12
would reformat /opt/dewolf/decompiler/backend/codegenerator.py
would reformat /opt/dewolf/__init__.py
would reformat /opt/dewolf/decompiler/frontend/__init__.py
would reformat /opt/dewolf/decompiler/frontend/binaryninja/handlers/__init__.py
would reformat /opt/dewolf/decompiler/backend/variabledeclarations.py
would reformat /opt/dewolf/decompiler/frontend/binaryninja/frontend.py

[...]

Oh no! 💥 💔 💥
107 files would be reformatted, 204 files would be left unchanged.

Mostly those failures consists of adding a new line after the opening comment of a python file:

--- /opt/binaryninja/plugins/dewolf/tests/pipeline/controlflowanalysis/restructuring_commons/test_condition_aware_refinement.py     2023-08-17 14:01:07.815326+00:00
+++ /opt/binaryninja/plugins/dewolf/tests/pipeline/controlflowanalysis/restructuring_commons/test_condition_aware_refinement.py     2024-01-29 12:17:44.659690+00:00
@@ -1,6 +1,7 @@
 """ Tests for the PatternIndependentRestructuring pipeline stage condition aware refinement."""
+
 from itertools import combinations
 from typing import List, Tuple, Union

 import pytest
 from decompiler.pipeline.controlflowanalysis.restructuring import PatternIndependentRestructuring
would reformat /opt/binaryninja/plugins/dewolf/tests/pipeline/controlflowanalysis/restructuring_commons/test_condition_aware_refinement.py

This PR should make the formatting consistent again.

@fnhartmann fnhartmann changed the title Formatted with new Black version Black update Jan 29, 2024
@fnhartmann fnhartmann self-assigned this Jan 29, 2024
@blattm blattm self-requested a review January 29, 2024 13:24
Copy link
Collaborator

@blattm blattm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good! Thank you for your contribution :)

@blattm blattm merged commit d394012 into main Jan 29, 2024
2 checks passed
@blattm blattm deleted the black-update branch January 29, 2024 13:45
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.

None yet

2 participants