chore: ruff linter

- replace pylint & isort
This commit is contained in:
Ming Di Leom 2023-03-06 10:46:34 +00:00
parent 34b8f39eca
commit 5f11caab67
No known key found for this signature in database
GPG Key ID: 32D3E28E96A695E8
6 changed files with 14 additions and 27 deletions

1
.gitignore vendored
View File

@ -4,3 +4,4 @@ pip-log.txt
pip-delete-this-directory.txt
lib/
malware_filter-*.tar.gz
.ruff_cache/

View File

@ -17,28 +17,15 @@ repos:
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/PyCQA/isort
rev: "5.11.4"
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: "v0.0.254"
hooks:
- id: isort
types: [python]
args: [
".", # sort all Python files recursively
]
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- repo: https://github.com/psf/black
rev: 22.12.0
hooks:
- id: black
- repo: https://github.com/PyCQA/pylint
rev: "v2.15.10"
hooks:
- id: pylint
language: system
types: [python]
args: [
"-rn", # Only display messages
"-sn", # Don't display the score
]
- repo: https://github.com/pre-commit/mirrors-prettier
rev: "v2.7.1"
hooks:

View File

@ -9,14 +9,10 @@
"editor.formatOnSave": true,
"editor.tabSize": 4,
"editor.codeActionsOnSave": {
"source.fixAll": true,
"source.organizeImports": true
}
},
"isort.args": ["--profile", "black"],
"[javascript]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[markdown]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode"

View File

@ -105,7 +105,8 @@ class Utility:
Arguments:
row {dict} -- A row of an array-parsed CSV
prefix_opt {string/list} -- A column name or a comma-separated list of column names to have wildcard prefixed to their non-empty value.
prefix_opt {string/list} -- A column name or a comma-separated list of column names to have
wildcard prefixed to their non-empty value.
suffix_opt {string/list} -- Same as prefix_opt but have the wildcard suffixed instead.
affix_opt {string/list} -- Same as prefix_opt but have the wildcard prefixed and suffixed.

View File

@ -1,6 +1,3 @@
[tool.isort]
profile = "black"
[tool.pylint.'MASTER']
py-version = "3.10"
init-hook='import sys; sys.path.append("./bin")'
@ -30,3 +27,8 @@ disable = [
indent-after-paren = 4
indent-string = " "
expected-line-ending-format="LF"
[tool.ruff]
line-length = 115
# Module level import not at top of file (`E402`).
ignore = ["E402"]

View File

@ -1,5 +1,5 @@
-r requirements.txt
pylint == 2.*
isort == 5.*
pre-commit == 2.*
black ~= 22.1
ruff == 0.0.*