-
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
Implement flake8-bandit rule S108
#1644
Conversation
00dfdfd
to
7705ba2
Compare
|
||
#[derive(Debug, Hash)] | ||
pub struct Settings { | ||
pub hardcoded_tmp_directory: Vec<String>, |
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.
You could consider just having hardcoded_tmp_directory
(removing hardcoded_tmp_directory_extend
from Settings
), and then concatenating the two in From<Options>
.
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.
Yeah, that makes sense.
src/flake8_bandit/mod.rs
Outdated
#[test_case(CheckCode::S105, Path::new("S105.py"), Settings::default(), "S105"; "S105")] | ||
#[test_case(CheckCode::S106, Path::new("S106.py"), Settings::default(), "S106"; "S106")] | ||
#[test_case(CheckCode::S107, Path::new("S107.py"), Settings::default(), "S107"; "S107")] | ||
#[test_case(CheckCode::S108, Path::new("S108.py"), Settings::default(), "S108_default"; "S108_0")] |
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.
Looks reasonable to me. For other plugins, we tend to use the default, and create dedicated test-cases for overridden settings. But this is cool too.
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.
Thanks for the feedback. These were a bit unreadable so I refactored them.
e26fe01
to
f8023ff
Compare
[![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://togithub.com/charliermarsh/ruff) | `^0.0.210` -> `^0.0.211` | [![age](https://badges.renovateapi.com/packages/pypi/ruff/0.0.211/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/pypi/ruff/0.0.211/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/pypi/ruff/0.0.211/compatibility-slim/0.0.210)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/pypi/ruff/0.0.211/confidence-slim/0.0.210)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>charliermarsh/ruff</summary> ### [`v0.0.211`](https://togithub.com/charliermarsh/ruff/releases/tag/v0.0.211) [Compare Source](https://togithub.com/charliermarsh/ruff/compare/v0.0.210...v0.0.211) #### What's Changed - Implement `SIM220` and `SIM221` by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/1630](https://togithub.com/charliermarsh/ruff/pull/1630) - Implement flake8-simplify SIM105 rule by [@​messense](https://togithub.com/messense) in [https://github.com/charliermarsh/ruff/pull/1621](https://togithub.com/charliermarsh/ruff/pull/1621) - Fix `SIM105` by [@​harupy](https://togithub.com/harupy) in [https://github.com/charliermarsh/ruff/pull/1633](https://togithub.com/charliermarsh/ruff/pull/1633) - Adding my company to the "used in" category of the Readme. by [@​colin99d](https://togithub.com/colin99d) in [https://github.com/charliermarsh/ruff/pull/1631](https://togithub.com/charliermarsh/ruff/pull/1631) - Implement flake8-bandit rule `S103` by [@​edgarrmondragon](https://togithub.com/edgarrmondragon) in [https://github.com/charliermarsh/ruff/pull/1636](https://togithub.com/charliermarsh/ruff/pull/1636) - Rename flake8-bandit rules from plugins to checks by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/1637](https://togithub.com/charliermarsh/ruff/pull/1637) - Tweak Yoda condition message by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/1638](https://togithub.com/charliermarsh/ruff/pull/1638) - Note a few more incompatibilities by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/1639](https://togithub.com/charliermarsh/ruff/pull/1639) - Add task-tags & ignore-overlong-task-comments settings by [@​not-my-profile](https://togithub.com/not-my-profile) in [https://github.com/charliermarsh/ruff/pull/1550](https://togithub.com/charliermarsh/ruff/pull/1550) - Add badge JSON by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/1641](https://togithub.com/charliermarsh/ruff/pull/1641) - Add Ruff badge to README by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/1642](https://togithub.com/charliermarsh/ruff/pull/1642) - DRY up unused import removal code by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/1643](https://togithub.com/charliermarsh/ruff/pull/1643) - Implement builtin import removal by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/1645](https://togithub.com/charliermarsh/ruff/pull/1645) - Move external licenses to separate directory by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/1648](https://togithub.com/charliermarsh/ruff/pull/1648) - Implement nested-if detection by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/1649](https://togithub.com/charliermarsh/ruff/pull/1649) - Implement flake8-bandit rule `S108` by [@​edgarrmondragon](https://togithub.com/edgarrmondragon) in [https://github.com/charliermarsh/ruff/pull/1644](https://togithub.com/charliermarsh/ruff/pull/1644) - Implement nested with detection (SIM117) by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/1651](https://togithub.com/charliermarsh/ruff/pull/1651) - Cancel outdated in-progress workflow automatically by [@​messense](https://togithub.com/messense) in [https://github.com/charliermarsh/ruff/pull/1652](https://togithub.com/charliermarsh/ruff/pull/1652) - Implement flake8-simplify SIM107 by [@​messense](https://togithub.com/messense) in [https://github.com/charliermarsh/ruff/pull/1650](https://togithub.com/charliermarsh/ruff/pull/1650) - Implement `SIM110` and `SIM111` (conversion to `any` and `all`) by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/1653](https://togithub.com/charliermarsh/ruff/pull/1653) **Full Changelog**: astral-sh/ruff@v0.0.210...v0.0.211 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR is behind base branch, 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://app.renovatebot.com/dashboard#github/ixm-one/pytest-cmake-presets). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC44MS4wIiwidXBkYXRlZEluVmVyIjoiMzQuODEuMCJ9--> Signed-off-by: Renovate Bot <bot@renovateapp.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Releated: #1646