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

Run black over the codebase #1760

Merged
merged 3 commits into from Sep 27, 2021
Merged

Run black over the codebase #1760

merged 3 commits into from Sep 27, 2021

Conversation

corranwebster
Copy link
Contributor

@corranwebster corranwebster commented Sep 23, 2021

Updates the setup.cfg for the things that now pass. Adds a pyproject.toml so that future runs of black have the same settings.

There is manual clean-up that is needed at this point: there are lines that were protected by # noqa for E501 (line length) which no-longer make sense. Those should be fixed in a separate PR which cleans up the E501 status.

Checklist

  • Add a news fragment if this PR is news-worthy for end users. (see docs/releases/README.rst)

Copy link
Contributor

@rahulporuri rahulporuri left a comment

Choose a reason for hiding this comment

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

I didnt review all of the changes black made but I trust it enough by now. LGTM. Please feel free to ignore my comments, they can be addressed separately/later.

@@ -1021,7 +1000,7 @@ def get_children(self):
tooltip="Go to next file",
action="do_parent",
enabled_when="(selected_node is not None) and "
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
enabled_when="(selected_node is not None) and "
enabled_when=(
"(selected_node is not None) "
"and (object.selected_node.parent is not None)"
),

@@ -1021,7 +1000,7 @@ def get_children(self):
tooltip="Go to next file",
action="do_parent",
enabled_when="(selected_node is not None) and "
"(object.selected_node.parent is not None)",
"(object.selected_node.parent is not None)",
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"(object.selected_node.parent is not None)",

@@ -36,7 +36,7 @@ def get_html_tag(tag):


def get_action_enabled(action, model_view):
""" Helper funciton to return if a tool is enabled.
"""Helper funciton to return if a tool is enabled.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"""Helper funciton to return if a tool is enabled.
"""Helper function to return if a tool is enabled.

Comment on lines +53 to +61
with mock_iter_entry_points(
{}
), mock_demo_launch(), mocked_io, mock.patch(
"sys.stdout", mocked_io
), mock.patch(
"sys.stderr", mocked_io
), mock.patch(
"sys.argv", argv
):
Copy link
Contributor

Choose a reason for hiding this comment

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

sigh. these look awkward. but we can't use (...) in with statements in Python 3.6 IIUC. Not much we can do if we can to keep the codebase black-happy.

commands = ["edm environments create {environment} --platform=rh6-x86_64 --force --version={runtime}"] # noqa: E501
commands = [
"edm environments create {environment} --platform=rh6-x86_64 --force --version={runtime}"
] # noqa: E501
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
] # noqa: E501
]

])
commands = [
"edm environments create {environment} --force --version={runtime}"
] # noqa: E501
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
] # noqa: E501
]

@corranwebster
Copy link
Contributor Author

Thanks, I deliberately avoided manual fix-ups in this PR, but the things you noticed are definitely useful for another PR which does things like sort out the # noqa stuff that isn't needed anymore

@corranwebster corranwebster merged commit 88182ca into main Sep 27, 2021
@corranwebster corranwebster deleted the fix/flake8-code-layout branch September 27, 2021 10:41
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