Skip to content

Commit

Permalink
Revert "Implement flake8-i18n (#3741)" (#3765)
Browse files Browse the repository at this point in the history
  • Loading branch information
charliermarsh authored Mar 27, 2023
1 parent 0eb5a22 commit c3917ea
Show file tree
Hide file tree
Showing 22 changed files with 20 additions and 371 deletions.
2 changes: 0 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,6 @@ are:
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
"""

- flake8-i18n, licensed as "GNU General Public License v2 (GPLv2)".

- flake8-implicit-str-concat, licensed as follows:
"""
The MIT License (MIT)
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,6 @@ quality tools, including:
- [flake8-eradicate](https://pypi.org/project/flake8-eradicate/)
- [flake8-errmsg](https://pypi.org/project/flake8-errmsg/)
- [flake8-executable](https://pypi.org/project/flake8-executable/)
- [flake8-i18n](https://pypi.org/project/flake8-i18n/)
- [flake8-implicit-str-concat](https://pypi.org/project/flake8-implicit-str-concat/)
- [flake8-import-conventions](https://github.com/joaopalmeiro/flake8-import-conventions)
- [flake8-logging-format](https://pypi.org/project/flake8-logging-format/)
Expand Down
1 change: 0 additions & 1 deletion crates/ruff/resources/test/fixtures/flake8_i18n/INT001.py

This file was deleted.

1 change: 0 additions & 1 deletion crates/ruff/resources/test/fixtures/flake8_i18n/INT002.py

This file was deleted.

1 change: 0 additions & 1 deletion crates/ruff/resources/test/fixtures/flake8_i18n/INT003.py

This file was deleted.

34 changes: 5 additions & 29 deletions crates/ruff/src/checkers/ast/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,11 @@ use crate::registry::{AsRule, Rule};
use crate::rules::{
flake8_2020, flake8_annotations, flake8_bandit, flake8_blind_except, flake8_boolean_trap,
flake8_bugbear, flake8_builtins, flake8_comprehensions, flake8_datetimez, flake8_debugger,
flake8_django, flake8_errmsg, flake8_i18n, flake8_implicit_str_concat,
flake8_import_conventions, flake8_logging_format, flake8_pie, flake8_print, flake8_pyi,
flake8_pytest_style, flake8_raise, flake8_return, flake8_self, flake8_simplify,
flake8_tidy_imports, flake8_type_checking, flake8_unused_arguments, flake8_use_pathlib, mccabe,
numpy, pandas_vet, pep8_naming, pycodestyle, pydocstyle, pyflakes, pygrep_hooks, pylint,
pyupgrade, ruff, tryceratops,
flake8_django, flake8_errmsg, flake8_implicit_str_concat, flake8_import_conventions,
flake8_logging_format, flake8_pie, flake8_print, flake8_pyi, flake8_pytest_style, flake8_raise,
flake8_return, flake8_self, flake8_simplify, flake8_tidy_imports, flake8_type_checking,
flake8_unused_arguments, flake8_use_pathlib, mccabe, numpy, pandas_vet, pep8_naming,
pycodestyle, pydocstyle, pyflakes, pygrep_hooks, pylint, pyupgrade, ruff, tryceratops,
};
use crate::settings::types::PythonVersion;
use crate::settings::{flags, Settings};
Expand Down Expand Up @@ -2906,29 +2905,6 @@ where
}
}

// flake8-i18n
if self.settings.rules.any_enabled(&[
Rule::FStringInI18NFuncCall,
Rule::FormatInI18NFuncCall,
Rule::PrintfInI18NFuncCall,
]) && flake8_i18n::rules::is_i18n_func_call(
func,
&self.settings.flake8_i18n.functions_names,
) {
if self.settings.rules.enabled(Rule::FStringInI18NFuncCall) {
self.diagnostics
.extend(flake8_i18n::rules::f_string_in_i18n_func_call(args));
}
if self.settings.rules.enabled(Rule::FormatInI18NFuncCall) {
self.diagnostics
.extend(flake8_i18n::rules::format_in_i18n_func_call(args));
}
if self.settings.rules.enabled(Rule::PrintfInI18NFuncCall) {
self.diagnostics
.extend(flake8_i18n::rules::printf_in_i18n_func_call(args));
}
}

// flake8-simplify
if self
.settings
Expand Down
5 changes: 0 additions & 5 deletions crates/ruff/src/codes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -284,11 +284,6 @@ pub fn code_to_rule(linter: Linter, code: &str) -> Option<Rule> {
(Flake8Return, "507") => Rule::SuperfluousElseContinue,
(Flake8Return, "508") => Rule::SuperfluousElseBreak,

// flake8-i18n
(Flake8I18N, "001") => Rule::FStringInI18NFuncCall,
(Flake8I18N, "002") => Rule::FormatInI18NFuncCall,
(Flake8I18N, "003") => Rule::PrintfInI18NFuncCall,

// flake8-implicit-str-concat
(Flake8ImplicitStrConcat, "001") => Rule::SingleLineImplicitStringConcatenation,
(Flake8ImplicitStrConcat, "002") => Rule::MultiLineImplicitStringConcatenation,
Expand Down
7 changes: 0 additions & 7 deletions crates/ruff/src/registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -628,10 +628,6 @@ ruff_macros::register_rules!(
rules::flake8_raise::rules::UnnecessaryParenOnRaiseException,
// flake8-self
rules::flake8_self::rules::PrivateMemberAccess,
// flake8-i18n
rules::flake8_i18n::rules::FStringInI18NFuncCall,
rules::flake8_i18n::rules::FormatInI18NFuncCall,
rules::flake8_i18n::rules::PrintfInI18NFuncCall,
// numpy
rules::numpy::rules::NumpyDeprecatedTypeAlias,
rules::numpy::rules::NumpyLegacyRandom,
Expand Down Expand Up @@ -782,9 +778,6 @@ pub enum Linter {
/// [flake8-type-checking](https://pypi.org/project/flake8-type-checking/)
#[prefix = "TCH"]
Flake8TypeChecking,
/// [flake8-i18n](https://pypi.org/project/flake8-i18n/)
#[prefix = "INT"]
Flake8I18N,
/// [flake8-unused-arguments](https://pypi.org/project/flake8-unused-arguments/)
#[prefix = "ARG"]
Flake8UnusedArguments,
Expand Down
29 changes: 0 additions & 29 deletions crates/ruff/src/rules/flake8_i18n/mod.rs

This file was deleted.

91 changes: 0 additions & 91 deletions crates/ruff/src/rules/flake8_i18n/rules.rs

This file was deleted.

73 changes: 0 additions & 73 deletions crates/ruff/src/rules/flake8_i18n/settings.rs

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion crates/ruff/src/rules/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ pub mod flake8_debugger;
pub mod flake8_django;
pub mod flake8_errmsg;
pub mod flake8_executable;
pub mod flake8_i18n;
pub mod flake8_implicit_str_concat;
pub mod flake8_import_conventions;
pub mod flake8_logging_format;
Expand Down
Loading

0 comments on commit c3917ea

Please sign in to comment.