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

[MAINTENANCE] Enable SIM300 #9834

Merged
merged 5 commits into from
Apr 29, 2024
Merged

[MAINTENANCE] Enable SIM300 #9834

merged 5 commits into from
Apr 29, 2024

Conversation

anthonyburdi
Copy link
Member

@anthonyburdi anthonyburdi commented Apr 29, 2024

https://docs.astral.sh/ruff/rules/yoda-conditions/

yoda-conditions (SIM300)

Derived from the flake8-simplify linter.

Fix is sometimes available.

What it does

Checks for conditions that position a constant on the left-hand side of the
comparison operator, rather than the right-hand side.

Why is this bad?

These conditions (sometimes referred to as "Yoda conditions") are less
readable than conditions that place the variable on the left-hand side of
the comparison operator.

In some languages, Yoda conditions are used to prevent accidental
assignment in conditions (i.e., accidental uses of the = operator,
instead of the == operator). However, Python does not allow assignments
in conditions unless using the := operator, so Yoda conditions provide
no benefit in this regard.

Example

if "Foo" == foo:
    ...

Use instead:

if foo == "Foo":
    ...

References

@anthonyburdi anthonyburdi changed the title M/ /enable sim300 take 2 [MAINTENANCE] Enable SIM300 Apr 29, 2024
@anthonyburdi anthonyburdi marked this pull request as ready for review April 29, 2024 17:34
@anthonyburdi anthonyburdi self-assigned this Apr 29, 2024
Copy link

netlify bot commented Apr 29, 2024

Deploy Preview for niobium-lead-7998 canceled.

Name Link
🔨 Latest commit b3286ca
🔍 Latest deploy log https://app.netlify.com/sites/niobium-lead-7998/deploys/662fda02fe2c930008a5a77c

Copy link

codecov bot commented Apr 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.54%. Comparing base (f204d6b) to head (b3286ca).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #9834   +/-   ##
========================================
  Coverage    82.54%   82.54%           
========================================
  Files          504      504           
  Lines        45097    45097           
========================================
  Hits         37227    37227           
  Misses        7870     7870           
Flag Coverage Δ
3.10 65.64% <100.00%> (ø)
3.11 65.64% <100.00%> (ø)
3.11 athena or clickhouse or openpyxl or pyarrow or project or sqlite or aws_creds 53.31% <50.00%> (ø)
3.11 aws_deps 44.21% <0.00%> (ø)
3.11 big 61.07% <50.00%> (ø)
3.11 databricks 45.26% <50.00%> (ø)
3.11 filesystem 62.53% <50.00%> (ø)
3.11 mssql 47.97% <50.00%> (ø)
3.11 mysql ?
3.11 postgresql 51.68% <50.00%> (ø)
3.11 snowflake 45.85% <50.00%> (-0.01%) ⬇️
3.11 spark 57.83% <50.00%> (ø)
3.11 trino 51.00% <50.00%> (ø)
3.8 65.66% <100.00%> (ø)
3.8 athena or clickhouse or openpyxl or pyarrow or project or sqlite or aws_creds 53.32% <50.00%> (ø)
3.8 aws_deps 44.22% <0.00%> (ø)
3.8 big 61.07% <50.00%> (ø)
3.8 databricks 45.27% <50.00%> (ø)
3.8 filesystem 62.54% <50.00%> (ø)
3.8 mssql 47.95% <50.00%> (ø)
3.8 mysql 48.01% <50.00%> (ø)
3.8 postgresql 51.67% <50.00%> (ø)
3.8 snowflake 45.86% <50.00%> (ø)
3.8 spark 57.78% <50.00%> (ø)
3.8 trino 50.99% <50.00%> (ø)
3.9 65.65% <100.00%> (ø)
cloud 0.00% <0.00%> (ø)
docs-basic 52.02% <50.00%> (ø)
docs-creds-needed 52.95% <50.00%> (ø)
docs-spark 51.66% <50.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Kilo59 Kilo59 added this pull request to the merge queue Apr 29, 2024
Merged via the queue into develop with commit 6c8d65d Apr 29, 2024
71 of 93 checks passed
@Kilo59 Kilo59 deleted the m/_/enable-SIM300-take-2 branch April 29, 2024 22:09
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

4 participants