Skip to content

Commit

Permalink
Revert "Add task-tags & ignore-overlong-task-comments settings (#1550)"
Browse files Browse the repository at this point in the history
This reverts commit ca48492.
  • Loading branch information
charliermarsh committed Jan 5, 2023
1 parent 7b59cd2 commit 3400be1
Show file tree
Hide file tree
Showing 17 changed files with 105 additions and 436 deletions.
42 changes: 0 additions & 42 deletions README.md
Expand Up @@ -2232,27 +2232,6 @@ target-version = "py37"
---
#### [`task-tags`](#task-tags)
A list of task tags to recognize (e.g., "TODO", "FIXME", "XXX").
Comments starting with these tags will be ignored by commented-out code
detection (`ERA`), and skipped by line-length checks (`E501`) if
`ignore-overlong-task-comments` is set to `true`.
**Default value**: `["TODO", "FIXME", "XXX"]`
**Type**: `Vec<String>`
**Example usage**:
```toml
[tool.ruff]
task-tags = ["HACK"]
```
---
#### [`unfixable`](#unfixable)
A list of check code prefixes to consider un-autofix-able.
Expand Down Expand Up @@ -3036,27 +3015,6 @@ staticmethod-decorators = ["staticmethod", "stcmthd"]
---
### `pycodestyle`
#### [`ignore-overlong-task-comments`](#ignore-overlong-task-comments)
Whether or not line-length checks (`E501`) should be triggered for
comments starting with `task-tags` (by default: ["TODO", "FIXME",
and "XXX"]).
**Default value**: `false`
**Type**: `bool`
**Example usage**:
```toml
[tool.ruff.pycodestyle]
ignore-overlong-task-comments = true
```
---
### `pydocstyle`
#### [`convention`](#convention)
Expand Down
14 changes: 0 additions & 14 deletions flake8_to_ruff/src/converter.rs
Expand Up @@ -390,7 +390,6 @@ mod tests {
src: None,
target_version: None,
unfixable: None,
task_tags: None,
update_check: None,
flake8_annotations: None,
flake8_bandit: None,
Expand All @@ -404,7 +403,6 @@ mod tests {
isort: None,
mccabe: None,
pep8_naming: None,
pycodestyle: None,
pydocstyle: None,
pyupgrade: None,
});
Expand Down Expand Up @@ -453,7 +451,6 @@ mod tests {
src: None,
target_version: None,
unfixable: None,
task_tags: None,
update_check: None,
flake8_annotations: None,
flake8_bandit: None,
Expand All @@ -467,7 +464,6 @@ mod tests {
isort: None,
mccabe: None,
pep8_naming: None,
pycodestyle: None,
pydocstyle: None,
pyupgrade: None,
});
Expand Down Expand Up @@ -516,7 +512,6 @@ mod tests {
src: None,
target_version: None,
unfixable: None,
task_tags: None,
update_check: None,
flake8_annotations: None,
flake8_bandit: None,
Expand All @@ -530,7 +525,6 @@ mod tests {
isort: None,
mccabe: None,
pep8_naming: None,
pycodestyle: None,
pydocstyle: None,
pyupgrade: None,
});
Expand Down Expand Up @@ -579,7 +573,6 @@ mod tests {
src: None,
target_version: None,
unfixable: None,
task_tags: None,
update_check: None,
flake8_annotations: None,
flake8_bandit: None,
Expand All @@ -593,7 +586,6 @@ mod tests {
isort: None,
mccabe: None,
pep8_naming: None,
pycodestyle: None,
pydocstyle: None,
pyupgrade: None,
});
Expand Down Expand Up @@ -642,7 +634,6 @@ mod tests {
src: None,
target_version: None,
unfixable: None,
task_tags: None,
update_check: None,
flake8_annotations: None,
flake8_bandit: None,
Expand All @@ -661,7 +652,6 @@ mod tests {
isort: None,
mccabe: None,
pep8_naming: None,
pycodestyle: None,
pydocstyle: None,
pyupgrade: None,
});
Expand Down Expand Up @@ -714,7 +704,6 @@ mod tests {
src: None,
target_version: None,
unfixable: None,
task_tags: None,
update_check: None,
flake8_annotations: None,
flake8_bandit: None,
Expand All @@ -728,7 +717,6 @@ mod tests {
isort: None,
mccabe: None,
pep8_naming: None,
pycodestyle: None,
pydocstyle: Some(pydocstyle::settings::Options {
convention: Some(Convention::Numpy),
}),
Expand Down Expand Up @@ -780,7 +768,6 @@ mod tests {
src: None,
target_version: None,
unfixable: None,
task_tags: None,
update_check: None,
flake8_annotations: None,
flake8_bandit: None,
Expand All @@ -799,7 +786,6 @@ mod tests {
isort: None,
mccabe: None,
pep8_naming: None,
pycodestyle: None,
pydocstyle: None,
pyupgrade: None,
});
Expand Down
6 changes: 0 additions & 6 deletions resources/test/fixtures/pycodestyle/E501_1.py

This file was deleted.

34 changes: 0 additions & 34 deletions ruff.schema.json
Expand Up @@ -299,17 +299,6 @@
}
}
},
"pycodestyle": {
"description": "Options for the `pycodestyle` plugin.",
"anyOf": [
{
"$ref": "#/definitions/Pycodestyle"
},
{
"type": "null"
}
]
},
"pydocstyle": {
"description": "Options for the `pydocstyle` plugin.",
"anyOf": [
Expand Down Expand Up @@ -388,16 +377,6 @@
}
]
},
"task-tags": {
"description": "A list of task tags to recognize (e.g., \"TODO\", \"FIXME\", \"XXX\").\n\nComments starting with these tags will be ignored by commented-out code detection (`ERA`), and skipped by line-length checks (`E501`) if `ignore-overlong-task-comments` is set to `true`.",
"type": [
"array",
"null"
],
"items": {
"type": "string"
}
},
"unfixable": {
"description": "A list of check code prefixes to consider un-autofix-able.",
"type": [
Expand Down Expand Up @@ -1508,19 +1487,6 @@
},
"additionalProperties": false
},
"Pycodestyle": {
"type": "object",
"properties": {
"ignore-overlong-task-comments": {
"description": "Whether or not line-length checks (`E501`) should be triggered for comments starting with `task-tags` (by default: [\"TODO\", \"FIXME\", and \"XXX\"]).",
"type": [
"boolean",
"null"
]
}
},
"additionalProperties": false
},
"Pydocstyle": {
"type": "object",
"properties": {
Expand Down
2 changes: 1 addition & 1 deletion src/checkers/lines.rs
Expand Up @@ -57,7 +57,7 @@ pub fn check_lines(
}

if enforce_line_too_long {
if let Some(check) = line_too_long(index, line, settings) {
if let Some(check) = line_too_long(index, line, settings.line_length) {
checks.push(check);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/eradicate/checks.rs
Expand Up @@ -31,7 +31,7 @@ pub fn commented_out_code(
let line = locator.slice_source_code_range(&Range::new(location, end_location));

// Verify that the comment is on its own line, and that it contains code.
if is_standalone_comment(&line) && comment_contains_code(&line, &settings.task_tags[..]) {
if is_standalone_comment(&line) && comment_contains_code(&line) {
let mut check = Check::new(CheckKind::CommentedOutCode, Range::new(start, end));
if matches!(autofix, flags::Autofix::Enabled)
&& settings.fixable.contains(&CheckCode::ERA001)
Expand Down

0 comments on commit 3400be1

Please sign in to comment.