mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-27 20:39:13 +00:00
Require explicit opt-in for GitHub and Gitlab formats (#1697)
This commit is contained in:
parent
81b812d94c
commit
12d2526edb
2 changed files with 2 additions and 13 deletions
|
@ -1327,8 +1327,9 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
python -m pip install --upgrade pip
|
python -m pip install --upgrade pip
|
||||||
pip install ruff
|
pip install ruff
|
||||||
|
# Include `--format=github` to enable automatic inline annotations.
|
||||||
- name: Run Ruff
|
- name: Run Ruff
|
||||||
run: ruff .
|
run: ruff --format=github .
|
||||||
```
|
```
|
||||||
|
|
||||||
## FAQ
|
## FAQ
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
use std::env;
|
|
||||||
use std::hash::Hash;
|
use std::hash::Hash;
|
||||||
use std::ops::Deref;
|
use std::ops::Deref;
|
||||||
use std::path::{Path, PathBuf};
|
use std::path::{Path, PathBuf};
|
||||||
|
@ -164,17 +163,6 @@ pub enum SerializationFormat {
|
||||||
|
|
||||||
impl Default for SerializationFormat {
|
impl Default for SerializationFormat {
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
if let Ok(github_actions) = env::var("GITHUB_ACTIONS") {
|
|
||||||
if github_actions == "true" {
|
|
||||||
return Self::Github;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if let Ok(gitlab_ci) = env::var("GITLAB_CI") {
|
|
||||||
if gitlab_ci == "true" {
|
|
||||||
return Self::Gitlab;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Self::Text
|
Self::Text
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue