MPT-11914 Initial setup of wps and ruff rules#477
Conversation
d1d097e to
b6d243d
Compare
b6d243d to
8063a44
Compare
|
|
||
|
|
||
| class Command(BaseCommand): | ||
| class Command(AdobeBaseCommand): |
There was a problem hiding this comment.
This command covers the requirement from Sync Improvements. It syncs only 3yc_enroll status if it is in one of the temporary states and does full sync when it changes to commited. process_3yc does some other stuff as well which I do not fully understand, but it is definitely something more than just a synchronization. I think it make sense to keep pure sync separately from other operations.
| ) | ||
|
|
||
|
|
||
| def resubmit_3yc_commitment_request(mpt_client, is_recommitment=False): |
There was a problem hiding this comment.
I am not sure, but it wasn't used yet when I joined
8063a44 to
ca85fc9
Compare
|
| """ | ||
|
|
||
| Create Reseller Account on Adobe. |
There was a problem hiding this comment.
| """ | |
| Create Reseller Account on Adobe. | |
| """Create Reseller Account on Adobe. |
| response.raise_for_status() | ||
| return response.json() | ||
|
|
||
| def _do_not_make_return_params(self): |
There was a problem hiding this comment.
It's strange that mypy doesn't report anything about the typing. Do we have the correct config?
| def _do_not_make_return_params(self): | |
| def _do_not_make_return_params(self) -> dict[str, str]: |
There was a problem hiding this comment.
Ah! I've just realized we don't have mypy in this repo. 😢
| line_items (list): List of item to search. | ||
| sku (str): The partial SKU to search in | ||
| the list of item. |
There was a problem hiding this comment.
| line_items (list): List of item to search. | |
| sku (str): The partial SKU to search in | |
| the list of item. | |
| line_items: List of item to search. | |
| sku: The partial SKU to search in the list of item. |
|
|
||
|
|
||
| def get_item_by_partial_sku(items, sku): | ||
| def get_item_by_partial_sku(line_items, sku): |
There was a problem hiding this comment.
| def get_item_by_partial_sku(line_items, sku): | |
| def get_item_by_partial_sku(line_items: list, sku: str) -> str: |
| Converts Marketplace Line id to integer by extracting sequencial part of the line id. | ||
|
|
||
| Example: ALI-1234-1234-1234-0001 --> 1 | ||
| """ |
There was a problem hiding this comment.
I missed the Args and return sections
| def get_transfers_to_check(product_id: str): | ||
| """ |
There was a problem hiding this comment.
Looks like we also forgot the return typing in the methods below. They're not required now but...just in case
| def get_transfers_to_check(product_id: str): | |
| """ | |
| def get_transfers_to_check(product_id: str) -> list: | |
| """ |
| from django.core.management.base import BaseCommand | ||
|
|
||
|
|
||
| class AdobeBaseCommand(BaseCommand): |
| # Plugin configs: | ||
| flake8-import-conventions.banned-from = [ "ast", "datetime" ] | ||
| flake8-import-conventions.aliases = { datetime = "dt" } | ||
| flake8-quotes.inline-quotes = "double" | ||
| mccabe.max-complexity = 6 | ||
| pydocstyle.convention = "google" | ||
|
|
||
| [tool.ruff.lint.per-file-ignores] | ||
| "tests/*.py" = [ | ||
| "D103", # missing docstring in public function | ||
| "S101", # asserts | ||
| "S105", # hardcoded passwords | ||
| "S404", # subprocess calls are for tests | ||
| "S603", # do not require `shell=True` | ||
| "S607", # partial executable paths | ||
| ] | ||
|
|
||
| [tool.ruff.lint.isort] | ||
| known-third-party = ["swo"] |
There was a problem hiding this comment.
I'd like to use the new ruff format
| # Plugin configs: | |
| flake8-import-conventions.banned-from = [ "ast", "datetime" ] | |
| flake8-import-conventions.aliases = { datetime = "dt" } | |
| flake8-quotes.inline-quotes = "double" | |
| mccabe.max-complexity = 6 | |
| pydocstyle.convention = "google" | |
| [tool.ruff.lint.per-file-ignores] | |
| "tests/*.py" = [ | |
| "D103", # missing docstring in public function | |
| "S101", # asserts | |
| "S105", # hardcoded passwords | |
| "S404", # subprocess calls are for tests | |
| "S603", # do not require `shell=True` | |
| "S607", # partial executable paths | |
| ] | |
| [tool.ruff.lint.isort] | |
| known-third-party = ["swo"] | |
| [tool.ruff.lint.flake8-import-conventions] | |
| aliases = { datetime = "dt" } | |
| banned-from = [ "ast", "datetime" ] | |
| [tool.ruff.lint.flake8-quotes] | |
| inline-quotes = "double" | |
| [tool.ruff.lint.isort] | |
| known-third-party = ["swo"] | |
| [tool.ruff.lint.mccabe] | |
| max-complexity = 6 | |
| [tool.ruff.lint.per-file-ignores] | |
| "tests/*.py" = [ | |
| "D103", # missing docstring in public function | |
| "S101", # asserts | |
| "S105", # hardcoded passwords | |
| "S404", # subprocess calls are for tests | |
| "S603", # do not require `shell=True` | |
| "S607", # partial executable paths | |
| ] | |
| [tool.ruff.lint.pydocstyle] | |
| convention = "google" |
svazquezco
left a comment
There was a problem hiding this comment.
Great refactor! ❤️ That was a lot of work! I'm sure this will help us reach the next level 💪



No description provided.