Skip to content

⬆️ UPGRADE: Autoupdate pre-commit config #54043

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

Merged
merged 6 commits into from
Jul 10, 2023

Conversation

mroeschke
Copy link
Member

No description provided.

@mroeschke mroeschke added the Code Style Code style, linting, code_checks label Jul 7, 2023
@mroeschke mroeschke added this to the 2.1 milestone Jul 7, 2023
pyproject.toml Outdated
@@ -642,5 +646,5 @@ exclude_lines = [
directory = "coverage_html_report"

[tool.codespell]
ignore-words-list = "blocs, coo, hist, nd, sav, ser, recuse, nin, timere"
ignore-words-list = "blocs, coo, hist, nd, sav, ser, recuse, nin, timere, afile, foor, aas, mis"
Copy link
Member

Choose a reason for hiding this comment

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

Where are these new ignore words found?

Github code search doesn't seem to find them.

Copy link
Member Author

Choose a reason for hiding this comment

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

These are found in the tests, either partially or fully in string variables

Copy link
Member

Choose a reason for hiding this comment

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

Hm, might be good to add a comment or rename some of the variables.

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure thing. I'll just rename some variables

Copy link
Member

@MarcoGorelli MarcoGorelli left a comment

Choose a reason for hiding this comment

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

nice! thanks for noticing that it hadn't opened automatically

@@ -1322,7 +1322,7 @@ def searchsorted(
arr: ArrayLike,
value: NumpyValueArrayLike | ExtensionArray,
side: Literal["left", "right"] = "left",
sorter: NumpySorter = None,
sorter: NumpySorter | None = None,
Copy link
Member

Choose a reason for hiding this comment

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

niice

Comment on lines -255 to +259
nmsp_dict = {"xmlns": n for p, n in self.namespaces.items() if p != ""}
nmsp_dict = {
"xmlns": n # noqa: RUF011
for p, n in self.namespaces.items()
if p != ""
}
Copy link
Member

Choose a reason for hiding this comment

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

🤔 this does look a bit odd, but can be rewritten if necessary later

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah agreed (@ParfaitG if you have any insight here)

Copy link
Contributor

Choose a reason for hiding this comment

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

Because default namespaces have no prefixes, we allow users to pass a dictionary with empty string key. While etree uses the empty string for default namespaces ({'': URI_NAMESPACE}), lxml uses None for its key: {None : URI_NAMESPACE}.

However, looking at that code block though, it is repetitive where first if should format the prefix to key: f"xmlns:{p}". I can do a code cleanup later and add a test for more than two namespaces.

@mroeschke mroeschke merged commit 51c6e79 into main Jul 10, 2023
@mroeschke mroeschke deleted the create-pr-action/pre-commit-config-update-0 branch July 10, 2023 22:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code Style Code style, linting, code_checks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants