Skip to content

Add wemake-python-styleguide - #214

Closed
Khabib73 wants to merge 5 commits into
typeddjango:masterfrom
Khabib73:feat/add-wps
Closed

Khabib73 wants to merge 5 commits into
typeddjango:masterfrom
Khabib73:feat/add-wps

Conversation

@Khabib73

Copy link
Copy Markdown
Contributor

This is preparation for adding WPS.

Comment thread pytest_mypy_plugins/logic/text.py Outdated
Comment on lines +68 to +75
error_message += " "
# sys.stderr.write(' ')
for pos in range(min(_MAX_ALIGNMENT_WIDTH, max_len)):
if word1[pos : pos + 1] != word2[pos : pos + 1]:
error_message += _ALIGNMENT_MARKER
break
else:
error_message += " "

@Khabib73 Khabib73 Nov 1, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@sobolevn it seems we can improve perf, we know that str is a unmutable type, which means we copy error_message on each iteration! I suggest using list instead :)

Comment thread pytest_mypy_plugins/isolation.py Outdated
"""A context manager which allows the ability to set sys.path temporarily"""
path = sys.path[:]
"""Allow the ability to set ``sys.path`` temporarily."""
path = sys.path

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this is not correct, we need a copy here

@Khabib73

Khabib73 commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor Author

This project is written so poorly, it’s a complete opposite to WPS!🤭

@Khabib73
Khabib73 requested a review from sobolevn November 2, 2026 13:04
@Khabib73

Khabib73 commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor Author

@sobolevn Let’s conduct a review at this stage, because a lot of changes have been made. (then I will continue refactoring and add WPS in this pr)

@sobolevn sobolevn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't think that this project actually needs WPS :)
Because people who contribute to this project don't follow WPS.

Moreover, we don't really expect this project to grow. So, this would just create code churn :(

@sobolevn sobolevn closed this Nov 2, 2026
@Khabib73

Khabib73 commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor Author

No problem, but let me improve perf for my last PR 🙏🏻🙏🏻

  error_message += "     "
  for pos in range(min(_MAX_ALIGNMENT_WIDTH, max_len)):
      if word1[pos : pos + 1] != word2[pos : pos + 1]:
          error_message += _ALIGNMENT_MARKER
          break
      else:
          error_message += " "

I suggest using list instead :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants