Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#2273)
Browse files Browse the repository at this point in the history
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Rachel Lougee <[email protected]>
  • Loading branch information
pre-commit-ci[bot] and rachellougee authored Oct 25, 2024
1 parent af2e23e commit 0eb9ad3
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 14 deletions.
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
Expand All @@ -14,7 +14,7 @@ repos:
- id: check-toml
- id: debug-statements
- repo: https://github.com/scop/pre-commit-shfmt
rev: v3.8.0-1
rev: v3.10.0-1
hooks:
- id: shfmt
- repo: https://github.com/adrienverge/yamllint.git
Expand Down Expand Up @@ -44,7 +44,7 @@ repos:
- --exclude-files
- ".*_test.js"
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.4.10"
rev: "v0.7.0"
hooks:
- id: ruff-format
- id: ruff
Expand All @@ -57,7 +57,7 @@ repos:
- id: shellcheck
args: ["--severity=warning"]
- repo: https://github.com/rhysd/actionlint
rev: v1.7.1
rev: v1.7.3
hooks:
- id: actionlint
name: actionlint
Expand Down
2 changes: 1 addition & 1 deletion courses/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class CourseFactory(DjangoModelFactory):
page = factory.RelatedFactory("cms.factories.CoursePageFactory", "course")

@factory.post_generation
def departments(self, create, extracted, **kwargs): # noqa: ARG002
def departments(self, create, extracted, **kwargs): # noqa: ARG002, F811
if not create or not extracted:
return
self.departments.add(*extracted)
Expand Down
2 changes: 1 addition & 1 deletion courses/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ class ProgramAdminForm(ModelForm):

def __init__(self, *args, **kwargs):
initial = kwargs.pop("initial", {})
instance = kwargs.get("instance", None)
instance = kwargs.get("instance")

if instance is not None and instance.requirements_root is not None:
initial["requirements"] = self._serialize_requirements(
Expand Down
3 changes: 1 addition & 2 deletions ecommerce/discounts_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,7 @@ def test_discount_factory_adjustment(discounts, products):
if type(discount_logic) is DollarsOffDiscount:
discounted_price = product.price - discount.amount

if discounted_price < 0:
discounted_price = 0
discounted_price = max(discounted_price, 0)
elif type(discount_logic) is FixedPriceDiscount:
discounted_price = discount.amount
elif type(discount_logic) is PercentDiscount:
Expand Down
4 changes: 2 additions & 2 deletions ecommerce/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def compare_to_order(self, order): # noqa: C901
):
all_discounts_found = False

if all_items_found is False or all_discounts_found is False:
if all_items_found is False or all_discounts_found is False: # noqa: SIM103
return False

return True
Expand Down Expand Up @@ -359,7 +359,7 @@ def valid_now(self):
):
return False

if self.expiration_date is not None and self.expiration_date <= datetime.now(
if self.expiration_date is not None and self.expiration_date <= datetime.now( # noqa: SIM103
pytz.timezone(TIME_ZONE)
):
return False
Expand Down
2 changes: 1 addition & 1 deletion flexiblepricing/api_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ def create_run_and_product_and_discount(self, user, courseware_object):

return determine_courseware_flexible_price_discount(product, user)

def create_fp_and_compare_tiers( # noqa: PLR0913
def create_fp_and_compare_tiers(
self, courseware_object, income_usd, country_code, user, expected
):
"""
Expand Down
2 changes: 1 addition & 1 deletion main/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def create_tempfile_csv(rows_iter):
Returns:
SimpleUploadedFile: A temporary CSV file with the given contents
"""
f = tempfile.NamedTemporaryFile(suffix=".csv", delete=False)
f = tempfile.NamedTemporaryFile(suffix=".csv", delete=False) # noqa: SIM115
with open(f.name, "w", encoding="utf8", newline="") as f: # noqa: PTH123
writer = csv.writer(f, delimiter=",")
for row in rows_iter:
Expand Down
4 changes: 2 additions & 2 deletions repl.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
base_dir = os.path.dirname(os.path.abspath(__file__)) # noqa: PTH100, PTH120

sys.exit(
check_call(
[ # noqa: S603
check_call( # noqa: S603
[
os.path.join(base_dir, "manage.py"), # noqa: PTH118
"shell",
*sys.argv[1:],
Expand Down

0 comments on commit 0eb9ad3

Please sign in to comment.