-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[flake8-use-pathlib
] Implement os-path-getsize
and os-path-get(a|m|c)-time
(PTH202-205
)
#5835
Conversation
flake8-use-path
] Implement os-path-getsize
and os-path-get(a|m|c)-time
(PTH202-205
)flake8-use-pathlib
] Implement os-path-getsize
and os-path-get(a|m|c)-time
(PTH202-205
)
PR Check ResultsEcosystemℹ️ ecosystem check detected changes. (+19, -0, 0 error(s)) airflow (+8, -0)
+ airflow/dag_processing/manager.py:1134:51: PTH204 `os.path.getmtime` should be replaced by `Path.stat().st_mtime` + airflow/models/dagbag.py:293:64: PTH204 `os.path.getmtime` should be replaced by `Path.stat().st_mtime` + airflow/models/dagcode.py:117:17: PTH204 `os.path.getmtime` should be replaced by `Path.stat().st_mtime` + airflow/providers/amazon/aws/transfers/dynamodb_to_s3.py:200:16: PTH202 `os.path.getsize` should be replaced by `Path.stat().st_size` + airflow/sensors/filesystem.py:68:60: PTH204 `os.path.getmtime` should be replaced by `Path.stat().st_mtime` + airflow/triggers/file.py:66:34: PTH204 `os.path.getmtime` should be replaced by `Path.stat().st_mtime` + dev/breeze/src/airflow_breeze/utils/parallel.py:308:24: PTH202 `os.path.getsize` should be replaced by `Path.stat().st_size` + docs/exts/docs_build/fetch_inventories.py:93:71: PTH204 `os.path.getmtime` should be replaced by `Path.stat().st_mtime` bokeh (+2, -0)
+ src/bokeh/sphinxext/bokeh_gallery.py:122:26: PTH204 `os.path.getmtime` should be replaced by `Path.stat().st_mtime` + src/bokeh/sphinxext/bokeh_gallery.py:143:41: PTH204 `os.path.getmtime` should be replaced by `Path.stat().st_mtime` zulip (+9, -0)
+ scripts/lib/zulip_tools.py:356:12: PTH205 `os.path.getctime` should be replaced by `Path.stat().st_ctime` + scripts/setup/generate_secrets.py:66:47: PTH202 `os.path.getsize` should be replaced by `Path.stat().st_size` + tools/lib/test_server.py:64:45: PTH202 `os.path.getsize` should be replaced by `Path.stat().st_size` + zerver/data_import/mattermost.py:356:21: PTH202 `os.path.getsize` should be replaced by `Path.stat().st_size` + zerver/data_import/mattermost.py:357:24: PTH204 `os.path.getmtime` should be replaced by `Path.stat().st_mtime` + zerver/lib/compatibility.py:32:9: PTH204 `os.path.getmtime` should be replaced by `Path.stat().st_mtime` + zerver/lib/test_fixtures.py:355:33: PTH204 `os.path.getmtime` should be replaced by `Path.stat().st_mtime` + zerver/lib/test_fixtures.py:384:33: PTH204 `os.path.getmtime` should be replaced by `Path.stat().st_mtime` + zerver/lib/upload/local.py:114:43: PTH204 `os.path.getmtime` should be replaced by `Path.stat().st_mtime`
BenchmarkLinux
Windows
|
Ecosystem changes are correct |
/// PTH203 | ||
|
||
/// ## What it does | ||
/// Detects the use of `os.path.getatime`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// Detects the use of `os.path.getatime`. | |
/// Checks for the use of `os.path.getatime`. |
/// PTH205 | ||
|
||
/// ## What it does | ||
/// Detects the use of `os.path.getatime`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// Detects the use of `os.path.getatime`. | |
/// Checks for the use of `os.path.getctime`. |
@@ -41,6 +44,10 @@ pub(crate) fn replaceable_by_pathlib(checker: &mut Checker, expr: &Expr) { | |||
["os", "path", "dirname"] => Some(OsPathDirname.into()), | |||
["os", "path", "samefile"] => Some(OsPathSamefile.into()), | |||
["os", "path", "splitext"] => Some(OsPathSplitext.into()), | |||
["os", "path", "getsize"] => Some(OsPathGetsize.into()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Ref1]
use ruff_diagnostics::Violation; | ||
use ruff_macros::{derive_message_formats, violation}; | ||
|
||
/// PTH203 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think i'd rather place this (and the other two respectively) at [Ref1]. Currently, it's a doc comment (///
vs //
), so it would be the first line of the documentation ahead of "#What it does"
/// PTH204 | ||
|
||
/// ## What it does | ||
/// Detects the use of `os.path.getatime`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// Detects the use of `os.path.getatime`. | |
/// Checks for the use of `os.path.getmtime`. |
/// Detects the use of `os.path.getatime`. | ||
/// | ||
/// ## Why is this bad? | ||
/// `pathlib` offers high-level path manipulations of paths, `os` offers low-level manipulation of paths. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit (and kinda annoying since it's not automated, sorry): The rule description doc comment are generally wrapped at 80 characters
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [ruff](https://beta.ruff.rs/docs) ([source](https://github.com/astral-sh/ruff), [changelog](https://github.com/astral-sh/ruff/releases)) | `0.0.278` -> `0.0.280` | [![age](https://developer.mend.io/api/mc/badges/age/pypi/ruff/0.0.280?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/pypi/ruff/0.0.280?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/pypi/ruff/0.0.278/0.0.280?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/pypi/ruff/0.0.278/0.0.280?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>astral-sh/ruff (ruff)</summary> ### [`v0.0.280`](https://github.com/astral-sh/ruff/compare/v0.0.279...v0.0.280) [Compare Source](https://github.com/astral-sh/ruff/compare/v0.0.279...v0.0.280) ### [`v0.0.279`](https://github.com/astral-sh/ruff/releases/tag/v0.0.279) [Compare Source](https://github.com/astral-sh/ruff/compare/v0.0.278...v0.0.279) <!-- Release notes generated using configuration in .github/release.yml at v0.0.279 --> #### What's Changed ##### Rules - \[`flake8-pyi`] Implement flake8-pyi's PYI026 by [@​LaBatata101](https://github.com/LaBatata101) in [https://github.com/astral-sh/ruff/pull/5844](https://github.com/astral-sh/ruff/pull/5844) - \[`flake8-pyi`] Implement flake8-pyi's `PYI017` by [@​qdegraaf](https://github.com/qdegraaf) in [https://github.com/astral-sh/ruff/pull/5895](https://github.com/astral-sh/ruff/pull/5895) - \[`flake8-pyi`] Implement flake8-pyi's `PYI036` by [@​density](https://github.com/density) in [https://github.com/astral-sh/ruff/pull/5668](https://github.com/astral-sh/ruff/pull/5668) - \[`flake8-pyi`] Implement flake8-pyi's `PYI041` by [@​density](https://github.com/density) in [https://github.com/astral-sh/ruff/pull/5722](https://github.com/astral-sh/ruff/pull/5722) - \[`flake8-use-pathlib`] Implement `os-path-getsize` and `os-path-get(a|m|c)-time` (`PTH202-205`) by [@​sbrugman](https://github.com/sbrugman) in [https://github.com/astral-sh/ruff/pull/5835](https://github.com/astral-sh/ruff/pull/5835) - \[`flake8-use-pathlib`] Implement `path-constructor-default-argument` (`PTH201`) by [@​sbrugman](https://github.com/sbrugman) in [https://github.com/astral-sh/ruff/pull/5833](https://github.com/astral-sh/ruff/pull/5833) - \[`pandas-vet`] Implement constant series rule (`PD101`) by [@​sbrugman](https://github.com/sbrugman) in [https://github.com/astral-sh/ruff/pull/5802](https://github.com/astral-sh/ruff/pull/5802) - \[`pylint`] Implement Pylint's `consider-using-in` (`PLR1714`) by [@​tjkuson](https://github.com/tjkuson) in [https://github.com/astral-sh/ruff/pull/5193](https://github.com/astral-sh/ruff/pull/5193) ##### Rule changes - \[`flake8-annotations`] Check for `Any` in other types for `ANN401` by [@​dhruvmanila](https://github.com/dhruvmanila) in [https://github.com/astral-sh/ruff/pull/5601](https://github.com/astral-sh/ruff/pull/5601) - \[`flake8-bugbear`] Add autofix for B004 by [@​density](https://github.com/density) in [https://github.com/astral-sh/ruff/pull/5788](https://github.com/astral-sh/ruff/pull/5788) - \[`flake8-bugbear`] Remove `B904`'s lowercase exemption by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5751](https://github.com/astral-sh/ruff/pull/5751) - \[`flake8-use-pathlib`] extend PTH118 with `os.sep` by [@​sbrugman](https://github.com/sbrugman) in [https://github.com/astral-sh/ruff/pull/5935](https://github.com/astral-sh/ruff/pull/5935) - \[`pyupgrade`] Expand scope of `quoted-annotation` rule (`UP037`) by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5766](https://github.com/astral-sh/ruff/pull/5766) - \[`pyupgrade`] Extend PEP 604 rewrites to support some quoted annotations by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5725](https://github.com/astral-sh/ruff/pull/5725) - \[`ruff`] Expand `RUF015` to include all expression types by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5767](https://github.com/astral-sh/ruff/pull/5767) ##### Bug Fixes - Consider single element subscript expr for implicit optional by [@​dhruvmanila](https://github.com/dhruvmanila) in [https://github.com/astral-sh/ruff/pull/5717](https://github.com/astral-sh/ruff/pull/5717) - Ignore `Enum`-and-`str` subclasses for slots enforcement by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5749](https://github.com/astral-sh/ruff/pull/5749) - Avoid removing raw strings in comparison fixes by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5755](https://github.com/astral-sh/ruff/pull/5755) - Fix nested calls to `sorted` with differing arguments by [@​density](https://github.com/density) in [https://github.com/astral-sh/ruff/pull/5761](https://github.com/astral-sh/ruff/pull/5761) - Use unused variable detection to power `incorrect-dict-iterator` by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5763](https://github.com/astral-sh/ruff/pull/5763) - Include alias when formatting import-from structs by [@​guillaumeLepape](https://github.com/guillaumeLepape) in [https://github.com/astral-sh/ruff/pull/5786](https://github.com/astral-sh/ruff/pull/5786) - Make `lint_only` aware of the source kind by [@​dhruvmanila](https://github.com/dhruvmanila) in [https://github.com/astral-sh/ruff/pull/5876](https://github.com/astral-sh/ruff/pull/5876) - Restore `redefined-while-unused` violations in classes by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5926](https://github.com/astral-sh/ruff/pull/5926) - Flatten nested tuples when fixing UP007 violations by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5724](https://github.com/astral-sh/ruff/pull/5724) - Ignore Jupyter Notebooks for `--add-noqa` by [@​dhruvmanila](https://github.com/dhruvmanila) in [https://github.com/astral-sh/ruff/pull/5727](https://github.com/astral-sh/ruff/pull/5727) - Avoid checking `EXE001` and `EXE002` on WSL by [@​tjkuson](https://github.com/tjkuson) in [https://github.com/astral-sh/ruff/pull/5735](https://github.com/astral-sh/ruff/pull/5735) - Properly group assignment targets by [@​MichaReiser](https://github.com/MichaReiser) in [https://github.com/astral-sh/ruff/pull/5728](https://github.com/astral-sh/ruff/pull/5728) - Avoid stack overflow for non-BitOr binary types by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5743](https://github.com/astral-sh/ruff/pull/5743) - Move function visit out of `Expr::Call` branches by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5772](https://github.com/astral-sh/ruff/pull/5772) - \[B006] Add bytes to immutable types by [@​harupy](https://github.com/harupy) in [https://github.com/astral-sh/ruff/pull/5776](https://github.com/astral-sh/ruff/pull/5776) - Format `SetComp` by [@​lkh42t](https://github.com/lkh42t) in [https://github.com/astral-sh/ruff/pull/5774](https://github.com/astral-sh/ruff/pull/5774) - Gate `runtime-import-in-type-checking-block` (`TCH004`) behind enabled flag by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5789](https://github.com/astral-sh/ruff/pull/5789) - perf: only compute start offset for overlong lines by [@​sbrugman](https://github.com/sbrugman) in [https://github.com/astral-sh/ruff/pull/5811](https://github.com/astral-sh/ruff/pull/5811) - Change `pandas-use-of-dot-read-table` rule to emit only when `read_table` is used on CSV data by [@​tjkuson](https://github.com/tjkuson) in [https://github.com/astral-sh/ruff/pull/5807](https://github.com/astral-sh/ruff/pull/5807) - Do not fix `NamedTuple` calls containing both a list of fields and keywords by [@​harupy](https://github.com/harupy) in [https://github.com/astral-sh/ruff/pull/5799](https://github.com/astral-sh/ruff/pull/5799) - Ignore directories when collecting files to lint by [@​harupy](https://github.com/harupy) in [https://github.com/astral-sh/ruff/pull/5775](https://github.com/astral-sh/ruff/pull/5775) - Add filename to `noqa` warnings by [@​sobolevn](https://github.com/sobolevn) in [https://github.com/astral-sh/ruff/pull/5856](https://github.com/astral-sh/ruff/pull/5856) - Handle io errors gracefully by [@​konstin](https://github.com/konstin) in [https://github.com/astral-sh/ruff/pull/5611](https://github.com/astral-sh/ruff/pull/5611) - Allow `respect_gitignore` when not in a git repo by [@​dhruvmanila](https://github.com/dhruvmanila) in [https://github.com/astral-sh/ruff/pull/5937](https://github.com/astral-sh/ruff/pull/5937) #### New Contributors - [@​eggplants](https://github.com/eggplants) made their first contribution in [https://github.com/astral-sh/ruff/pull/5741](https://github.com/astral-sh/ruff/pull/5741) - [@​guillaumeLepape](https://github.com/guillaumeLepape) made their first contribution in [https://github.com/astral-sh/ruff/pull/5786](https://github.com/astral-sh/ruff/pull/5786) - [@​odiseo0](https://github.com/odiseo0) made their first contribution in [https://github.com/astral-sh/ruff/pull/5888](https://github.com/astral-sh/ruff/pull/5888) - [@​DavidCain](https://github.com/DavidCain) made their first contribution in [https://github.com/astral-sh/ruff/pull/5889](https://github.com/astral-sh/ruff/pull/5889) - [@​LaBatata101](https://github.com/LaBatata101) made their first contribution in [https://github.com/astral-sh/ruff/pull/5844](https://github.com/astral-sh/ruff/pull/5844) **Full Changelog**: astral-sh/ruff@v0.0.278...v0.0.279 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/jankatins/pr-workflow-example). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi4xMS4wIiwidXBkYXRlZEluVmVyIjoiMzYuMTEuMCIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==-->
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [ruff](https://beta.ruff.rs/docs) ([source](https://github.com/astral-sh/ruff), [changelog](https://github.com/astral-sh/ruff/releases)) | `==0.0.278` -> `==0.0.280` | [![age](https://developer.mend.io/api/mc/badges/age/pypi/ruff/0.0.280?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/pypi/ruff/0.0.280?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/pypi/ruff/0.0.278/0.0.280?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/pypi/ruff/0.0.278/0.0.280?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>astral-sh/ruff (ruff)</summary> ### [`v0.0.280`](https://github.com/astral-sh/ruff/compare/v0.0.279...v0.0.280) [Compare Source](https://github.com/astral-sh/ruff/compare/v0.0.279...v0.0.280) ### [`v0.0.279`](https://github.com/astral-sh/ruff/releases/tag/v0.0.279) [Compare Source](https://github.com/astral-sh/ruff/compare/v0.0.278...v0.0.279) <!-- Release notes generated using configuration in .github/release.yml at v0.0.279 --> #### What's Changed ##### Rules - \[`flake8-pyi`] Implement flake8-pyi's PYI026 by [@​LaBatata101](https://github.com/LaBatata101) in [https://github.com/astral-sh/ruff/pull/5844](https://github.com/astral-sh/ruff/pull/5844) - \[`flake8-pyi`] Implement flake8-pyi's `PYI017` by [@​qdegraaf](https://github.com/qdegraaf) in [https://github.com/astral-sh/ruff/pull/5895](https://github.com/astral-sh/ruff/pull/5895) - \[`flake8-pyi`] Implement flake8-pyi's `PYI036` by [@​density](https://github.com/density) in [https://github.com/astral-sh/ruff/pull/5668](https://github.com/astral-sh/ruff/pull/5668) - \[`flake8-pyi`] Implement flake8-pyi's `PYI041` by [@​density](https://github.com/density) in [https://github.com/astral-sh/ruff/pull/5722](https://github.com/astral-sh/ruff/pull/5722) - \[`flake8-use-pathlib`] Implement `os-path-getsize` and `os-path-get(a|m|c)-time` (`PTH202-205`) by [@​sbrugman](https://github.com/sbrugman) in [https://github.com/astral-sh/ruff/pull/5835](https://github.com/astral-sh/ruff/pull/5835) - \[`flake8-use-pathlib`] Implement `path-constructor-default-argument` (`PTH201`) by [@​sbrugman](https://github.com/sbrugman) in [https://github.com/astral-sh/ruff/pull/5833](https://github.com/astral-sh/ruff/pull/5833) - \[`pandas-vet`] Implement constant series rule (`PD101`) by [@​sbrugman](https://github.com/sbrugman) in [https://github.com/astral-sh/ruff/pull/5802](https://github.com/astral-sh/ruff/pull/5802) - \[`pylint`] Implement Pylint's `consider-using-in` (`PLR1714`) by [@​tjkuson](https://github.com/tjkuson) in [https://github.com/astral-sh/ruff/pull/5193](https://github.com/astral-sh/ruff/pull/5193) ##### Rule changes - \[`flake8-annotations`] Check for `Any` in other types for `ANN401` by [@​dhruvmanila](https://github.com/dhruvmanila) in [https://github.com/astral-sh/ruff/pull/5601](https://github.com/astral-sh/ruff/pull/5601) - \[`flake8-bugbear`] Add autofix for B004 by [@​density](https://github.com/density) in [https://github.com/astral-sh/ruff/pull/5788](https://github.com/astral-sh/ruff/pull/5788) - \[`flake8-bugbear`] Remove `B904`'s lowercase exemption by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5751](https://github.com/astral-sh/ruff/pull/5751) - \[`flake8-use-pathlib`] extend PTH118 with `os.sep` by [@​sbrugman](https://github.com/sbrugman) in [https://github.com/astral-sh/ruff/pull/5935](https://github.com/astral-sh/ruff/pull/5935) - \[`pyupgrade`] Expand scope of `quoted-annotation` rule (`UP037`) by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5766](https://github.com/astral-sh/ruff/pull/5766) - \[`pyupgrade`] Extend PEP 604 rewrites to support some quoted annotations by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5725](https://github.com/astral-sh/ruff/pull/5725) - \[`ruff`] Expand `RUF015` to include all expression types by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5767](https://github.com/astral-sh/ruff/pull/5767) ##### Bug Fixes - Consider single element subscript expr for implicit optional by [@​dhruvmanila](https://github.com/dhruvmanila) in [https://github.com/astral-sh/ruff/pull/5717](https://github.com/astral-sh/ruff/pull/5717) - Ignore `Enum`-and-`str` subclasses for slots enforcement by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5749](https://github.com/astral-sh/ruff/pull/5749) - Avoid removing raw strings in comparison fixes by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5755](https://github.com/astral-sh/ruff/pull/5755) - Fix nested calls to `sorted` with differing arguments by [@​density](https://github.com/density) in [https://github.com/astral-sh/ruff/pull/5761](https://github.com/astral-sh/ruff/pull/5761) - Use unused variable detection to power `incorrect-dict-iterator` by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5763](https://github.com/astral-sh/ruff/pull/5763) - Include alias when formatting import-from structs by [@​guillaumeLepape](https://github.com/guillaumeLepape) in [https://github.com/astral-sh/ruff/pull/5786](https://github.com/astral-sh/ruff/pull/5786) - Make `lint_only` aware of the source kind by [@​dhruvmanila](https://github.com/dhruvmanila) in [https://github.com/astral-sh/ruff/pull/5876](https://github.com/astral-sh/ruff/pull/5876) - Restore `redefined-while-unused` violations in classes by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5926](https://github.com/astral-sh/ruff/pull/5926) - Flatten nested tuples when fixing UP007 violations by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5724](https://github.com/astral-sh/ruff/pull/5724) - Ignore Jupyter Notebooks for `--add-noqa` by [@​dhruvmanila](https://github.com/dhruvmanila) in [https://github.com/astral-sh/ruff/pull/5727](https://github.com/astral-sh/ruff/pull/5727) - Avoid checking `EXE001` and `EXE002` on WSL by [@​tjkuson](https://github.com/tjkuson) in [https://github.com/astral-sh/ruff/pull/5735](https://github.com/astral-sh/ruff/pull/5735) - Properly group assignment targets by [@​MichaReiser](https://github.com/MichaReiser) in [https://github.com/astral-sh/ruff/pull/5728](https://github.com/astral-sh/ruff/pull/5728) - Avoid stack overflow for non-BitOr binary types by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5743](https://github.com/astral-sh/ruff/pull/5743) - Move function visit out of `Expr::Call` branches by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5772](https://github.com/astral-sh/ruff/pull/5772) - \[B006] Add bytes to immutable types by [@​harupy](https://github.com/harupy) in [https://github.com/astral-sh/ruff/pull/5776](https://github.com/astral-sh/ruff/pull/5776) - Format `SetComp` by [@​lkh42t](https://github.com/lkh42t) in [https://github.com/astral-sh/ruff/pull/5774](https://github.com/astral-sh/ruff/pull/5774) - Gate `runtime-import-in-type-checking-block` (`TCH004`) behind enabled flag by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5789](https://github.com/astral-sh/ruff/pull/5789) - perf: only compute start offset for overlong lines by [@​sbrugman](https://github.com/sbrugman) in [https://github.com/astral-sh/ruff/pull/5811](https://github.com/astral-sh/ruff/pull/5811) - Change `pandas-use-of-dot-read-table` rule to emit only when `read_table` is used on CSV data by [@​tjkuson](https://github.com/tjkuson) in [https://github.com/astral-sh/ruff/pull/5807](https://github.com/astral-sh/ruff/pull/5807) - Do not fix `NamedTuple` calls containing both a list of fields and keywords by [@​harupy](https://github.com/harupy) in [https://github.com/astral-sh/ruff/pull/5799](https://github.com/astral-sh/ruff/pull/5799) - Ignore directories when collecting files to lint by [@​harupy](https://github.com/harupy) in [https://github.com/astral-sh/ruff/pull/5775](https://github.com/astral-sh/ruff/pull/5775) - Add filename to `noqa` warnings by [@​sobolevn](https://github.com/sobolevn) in [https://github.com/astral-sh/ruff/pull/5856](https://github.com/astral-sh/ruff/pull/5856) - Handle io errors gracefully by [@​konstin](https://github.com/konstin) in [https://github.com/astral-sh/ruff/pull/5611](https://github.com/astral-sh/ruff/pull/5611) - Allow `respect_gitignore` when not in a git repo by [@​dhruvmanila](https://github.com/dhruvmanila) in [https://github.com/astral-sh/ruff/pull/5937](https://github.com/astral-sh/ruff/pull/5937) #### New Contributors - [@​eggplants](https://github.com/eggplants) made their first contribution in [https://github.com/astral-sh/ruff/pull/5741](https://github.com/astral-sh/ruff/pull/5741) - [@​guillaumeLepape](https://github.com/guillaumeLepape) made their first contribution in [https://github.com/astral-sh/ruff/pull/5786](https://github.com/astral-sh/ruff/pull/5786) - [@​odiseo0](https://github.com/odiseo0) made their first contribution in [https://github.com/astral-sh/ruff/pull/5888](https://github.com/astral-sh/ruff/pull/5888) - [@​DavidCain](https://github.com/DavidCain) made their first contribution in [https://github.com/astral-sh/ruff/pull/5889](https://github.com/astral-sh/ruff/pull/5889) - [@​LaBatata101](https://github.com/LaBatata101) made their first contribution in [https://github.com/astral-sh/ruff/pull/5844](https://github.com/astral-sh/ruff/pull/5844) **Full Changelog**: astral-sh/ruff@v0.0.278...v0.0.279 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/allenporter/pyrainbird). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi4xMS4wIiwidXBkYXRlZEluVmVyIjoiMzYuMTEuMCIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [ruff](https://beta.ruff.rs/docs) ([source](https://github.com/astral-sh/ruff), [changelog](https://github.com/astral-sh/ruff/releases)) | `==0.0.278` -> `==0.0.280` | [![age](https://developer.mend.io/api/mc/badges/age/pypi/ruff/0.0.280?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/pypi/ruff/0.0.280?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/pypi/ruff/0.0.278/0.0.280?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/pypi/ruff/0.0.278/0.0.280?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>astral-sh/ruff (ruff)</summary> ### [`v0.0.280`](https://github.com/astral-sh/ruff/releases/tag/v0.0.280) [Compare Source](https://github.com/astral-sh/ruff/compare/v0.0.279...v0.0.280) <!-- Release notes generated using configuration in .github/release.yml at v0.0.280 --> #### What's Changed ##### Bug Fixes - Avoid collapsing `elif` and `else` branches during import sorting by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5964](https://github.com/astral-sh/ruff/pull/5964) **Full Changelog**: astral-sh/ruff@v0.0.279...v0.0.280 ### [`v0.0.279`](https://github.com/astral-sh/ruff/releases/tag/v0.0.279) [Compare Source](https://github.com/astral-sh/ruff/compare/v0.0.278...v0.0.279) <!-- Release notes generated using configuration in .github/release.yml at v0.0.279 --> #### What's Changed ##### Rules - \[`flake8-pyi`] Implement flake8-pyi's PYI026 by [@​LaBatata101](https://github.com/LaBatata101) in [https://github.com/astral-sh/ruff/pull/5844](https://github.com/astral-sh/ruff/pull/5844) - \[`flake8-pyi`] Implement flake8-pyi's `PYI017` by [@​qdegraaf](https://github.com/qdegraaf) in [https://github.com/astral-sh/ruff/pull/5895](https://github.com/astral-sh/ruff/pull/5895) - \[`flake8-pyi`] Implement flake8-pyi's `PYI036` by [@​density](https://github.com/density) in [https://github.com/astral-sh/ruff/pull/5668](https://github.com/astral-sh/ruff/pull/5668) - \[`flake8-pyi`] Implement flake8-pyi's `PYI041` by [@​density](https://github.com/density) in [https://github.com/astral-sh/ruff/pull/5722](https://github.com/astral-sh/ruff/pull/5722) - \[`flake8-use-pathlib`] Implement `os-path-getsize` and `os-path-get(a|m|c)-time` (`PTH202-205`) by [@​sbrugman](https://github.com/sbrugman) in [https://github.com/astral-sh/ruff/pull/5835](https://github.com/astral-sh/ruff/pull/5835) - \[`flake8-use-pathlib`] Implement `path-constructor-default-argument` (`PTH201`) by [@​sbrugman](https://github.com/sbrugman) in [https://github.com/astral-sh/ruff/pull/5833](https://github.com/astral-sh/ruff/pull/5833) - \[`pandas-vet`] Implement constant series rule (`PD101`) by [@​sbrugman](https://github.com/sbrugman) in [https://github.com/astral-sh/ruff/pull/5802](https://github.com/astral-sh/ruff/pull/5802) - \[`pylint`] Implement Pylint's `consider-using-in` (`PLR1714`) by [@​tjkuson](https://github.com/tjkuson) in [https://github.com/astral-sh/ruff/pull/5193](https://github.com/astral-sh/ruff/pull/5193) ##### Rule changes - \[`flake8-annotations`] Check for `Any` in other types for `ANN401` by [@​dhruvmanila](https://github.com/dhruvmanila) in [https://github.com/astral-sh/ruff/pull/5601](https://github.com/astral-sh/ruff/pull/5601) - \[`flake8-bugbear`] Add autofix for B004 by [@​density](https://github.com/density) in [https://github.com/astral-sh/ruff/pull/5788](https://github.com/astral-sh/ruff/pull/5788) - \[`flake8-bugbear`] Remove `B904`'s lowercase exemption by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5751](https://github.com/astral-sh/ruff/pull/5751) - \[`flake8-use-pathlib`] extend PTH118 with `os.sep` by [@​sbrugman](https://github.com/sbrugman) in [https://github.com/astral-sh/ruff/pull/5935](https://github.com/astral-sh/ruff/pull/5935) - \[`pyupgrade`] Expand scope of `quoted-annotation` rule (`UP037`) by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5766](https://github.com/astral-sh/ruff/pull/5766) - \[`pyupgrade`] Extend PEP 604 rewrites to support some quoted annotations by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5725](https://github.com/astral-sh/ruff/pull/5725) - \[`ruff`] Expand `RUF015` to include all expression types by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5767](https://github.com/astral-sh/ruff/pull/5767) ##### Bug Fixes - Consider single element subscript expr for implicit optional by [@​dhruvmanila](https://github.com/dhruvmanila) in [https://github.com/astral-sh/ruff/pull/5717](https://github.com/astral-sh/ruff/pull/5717) - Ignore `Enum`-and-`str` subclasses for slots enforcement by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5749](https://github.com/astral-sh/ruff/pull/5749) - Avoid removing raw strings in comparison fixes by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5755](https://github.com/astral-sh/ruff/pull/5755) - Fix nested calls to `sorted` with differing arguments by [@​density](https://github.com/density) in [https://github.com/astral-sh/ruff/pull/5761](https://github.com/astral-sh/ruff/pull/5761) - Use unused variable detection to power `incorrect-dict-iterator` by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5763](https://github.com/astral-sh/ruff/pull/5763) - Include alias when formatting import-from structs by [@​guillaumeLepape](https://github.com/guillaumeLepape) in [https://github.com/astral-sh/ruff/pull/5786](https://github.com/astral-sh/ruff/pull/5786) - Make `lint_only` aware of the source kind by [@​dhruvmanila](https://github.com/dhruvmanila) in [https://github.com/astral-sh/ruff/pull/5876](https://github.com/astral-sh/ruff/pull/5876) - Restore `redefined-while-unused` violations in classes by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5926](https://github.com/astral-sh/ruff/pull/5926) - Flatten nested tuples when fixing UP007 violations by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5724](https://github.com/astral-sh/ruff/pull/5724) - Ignore Jupyter Notebooks for `--add-noqa` by [@​dhruvmanila](https://github.com/dhruvmanila) in [https://github.com/astral-sh/ruff/pull/5727](https://github.com/astral-sh/ruff/pull/5727) - Avoid checking `EXE001` and `EXE002` on WSL by [@​tjkuson](https://github.com/tjkuson) in [https://github.com/astral-sh/ruff/pull/5735](https://github.com/astral-sh/ruff/pull/5735) - Properly group assignment targets by [@​MichaReiser](https://github.com/MichaReiser) in [https://github.com/astral-sh/ruff/pull/5728](https://github.com/astral-sh/ruff/pull/5728) - Avoid stack overflow for non-BitOr binary types by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5743](https://github.com/astral-sh/ruff/pull/5743) - Move function visit out of `Expr::Call` branches by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5772](https://github.com/astral-sh/ruff/pull/5772) - \[B006] Add bytes to immutable types by [@​harupy](https://github.com/harupy) in [https://github.com/astral-sh/ruff/pull/5776](https://github.com/astral-sh/ruff/pull/5776) - Format `SetComp` by [@​lkh42t](https://github.com/lkh42t) in [https://github.com/astral-sh/ruff/pull/5774](https://github.com/astral-sh/ruff/pull/5774) - Gate `runtime-import-in-type-checking-block` (`TCH004`) behind enabled flag by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/astral-sh/ruff/pull/5789](https://github.com/astral-sh/ruff/pull/5789) - perf: only compute start offset for overlong lines by [@​sbrugman](https://github.com/sbrugman) in [https://github.com/astral-sh/ruff/pull/5811](https://github.com/astral-sh/ruff/pull/5811) - Change `pandas-use-of-dot-read-table` rule to emit only when `read_table` is used on CSV data by [@​tjkuson](https://github.com/tjkuson) in [https://github.com/astral-sh/ruff/pull/5807](https://github.com/astral-sh/ruff/pull/5807) - Do not fix `NamedTuple` calls containing both a list of fields and keywords by [@​harupy](https://github.com/harupy) in [https://github.com/astral-sh/ruff/pull/5799](https://github.com/astral-sh/ruff/pull/5799) - Ignore directories when collecting files to lint by [@​harupy](https://github.com/harupy) in [https://github.com/astral-sh/ruff/pull/5775](https://github.com/astral-sh/ruff/pull/5775) - Add filename to `noqa` warnings by [@​sobolevn](https://github.com/sobolevn) in [https://github.com/astral-sh/ruff/pull/5856](https://github.com/astral-sh/ruff/pull/5856) - Handle io errors gracefully by [@​konstin](https://github.com/konstin) in [https://github.com/astral-sh/ruff/pull/5611](https://github.com/astral-sh/ruff/pull/5611) - Allow `respect_gitignore` when not in a git repo by [@​dhruvmanila](https://github.com/dhruvmanila) in [https://github.com/astral-sh/ruff/pull/5937](https://github.com/astral-sh/ruff/pull/5937) #### New Contributors - [@​eggplants](https://github.com/eggplants) made their first contribution in [https://github.com/astral-sh/ruff/pull/5741](https://github.com/astral-sh/ruff/pull/5741) - [@​guillaumeLepape](https://github.com/guillaumeLepape) made their first contribution in [https://github.com/astral-sh/ruff/pull/5786](https://github.com/astral-sh/ruff/pull/5786) - [@​odiseo0](https://github.com/odiseo0) made their first contribution in [https://github.com/astral-sh/ruff/pull/5888](https://github.com/astral-sh/ruff/pull/5888) - [@​DavidCain](https://github.com/DavidCain) made their first contribution in [https://github.com/astral-sh/ruff/pull/5889](https://github.com/astral-sh/ruff/pull/5889) - [@​LaBatata101](https://github.com/LaBatata101) made their first contribution in [https://github.com/astral-sh/ruff/pull/5844](https://github.com/astral-sh/ruff/pull/5844) **Full Changelog**: astral-sh/ruff@v0.0.278...v0.0.279 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/allenporter/flux-local). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi4xMS4wIiwidXBkYXRlZEluVmVyIjoiMzYuMTEuMCIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Reviving #2348 step by step
Pt 3. implement detection for:
os.path.getsize
os.path.getmtime
os.path.getctime
os.path.getatime