8000 added support for ruff linting and autoformatting by telamonian · Pull Request #149 · Comfy-Org/comfy-cli · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

added support for ruff linting and autoformatting #149

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

Merged
merged 8 commits into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Lint
name: ruff_check

on:
push:
Expand All @@ -9,18 +9,19 @@ on:
- main

jobs:
lint:
ruff_check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Install dependencies
- name: install ruff
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pylint
- name: Lint with Pylint
run: pylint --disable=R **/*.py
pip install ruff
- name: lint check and then format check with ruff
run: |
ruff check
ruff format --check
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ __pycache__/

#COMMON CONFIGs
.DS_Store
.ruff_cache
.src_port
.webpack_watch.log
*.swp
Expand Down
23 changes: 8 additions & 15 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
repos:
- repo: https://github.com/psf/black
rev: 22.3.0
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.6.1
hooks:
- id: black
- repo: https://github.com/pylint-dev/pylint
rev: v2.16.2
hooks:
- id: pylint
args:
# Note: E0401 is disabled as pylint does not run in an environment
# where the package is installed
- --disable=R,E0401
- repo: https://github.com/PyCQA/isort
rev: 5.13.2
hooks:
- id: isort
# Run the linter.
- id: ruff
args: [ --fix ]
# Run the formatter.
- id: ruff-format
52 changes: 25 additions & 27 deletions .pylintrc
Original file line number Diff line number Diff line change
@@ -1,30 +1,28 @@
[MASTER]
disable=
C0114, # missing-module-docstring
C0115, # missing-class-docstring
C0116, # missing-function-docstring
C0209, # consider-using-f-string
W0622, # redefined-builtin
W1113, # too-many-arguments
W0613, # unused-argument
W0718, # broad-exception-caught
W0511, # fixme
W0621, # redefined-outer-name
W1514, # unspecified-encoding
W0603, # global-statement
W1203, # logging-fstring-interpolation
W0212, # protected-access
C0301, # line-too-long
C0103, # invalid-name
W1510, # subprocess-run-check
W0707, # raise-missing-from
; [MASTER]
; disable=
; C0114, # missing-module-docstring
; C0115, # missing-class-docstring
; C0116, # missing-function-docstring
; C0209, # consider-using-f-string
; W0622, # redefined-builtin
; W1113, # too-many-arguments
; W0613, # unused-argument
; W0718, # broad-exception-caught
; W0511, # fixme
; W0621, # redefined-outer-name
; W1514, # unspecified-encoding
; W0603, # global-statement
; W1203, # logging-fstring-interpolation
; W0212, # protected-access
; C0301, # line-too-long
; W0707, # raise-missing-from

# TODO
W3101, # missing timeout on request
W0719, # broad-exception-raised
; # TODO
; W3101, # missing timeout on request
; W0719, # broad-exception-raised

[FORMAT]
max-line-length=120
; [FORMAT]
; max-line-length=120

[SIMILARITIES]
ignore-imports=yes
; [SIMILARITIES]
; ignore-imports=yes
12 changes: 0 additions & 12 deletions pylint_formatter.sh

This file was deleted.

62 changes: 39 additions & 23 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,31 +15,38 @@ maintainers = [
{name = "Yoland Yan", email = "yoland@drip.art"},
{name = "James Kwon", email = "hongilkwon316@gmail.com"},
{name = "Robin Huang", email = "robin@drip.art"},
{name = "Dr.Lt.Data", email = "dr.lt.data@gmail.com"}
]

dependencies = [
"typer>=0.9.0",
"GitPython",
"rich",
"requests",
"charset-normalizer>=3.0.0",
"pyyaml",
"typing-extensions>=4.7.0",
"mixpanel",
"questionary",
"psutil",
"tomlkit",
"pathspec",
"httpx",
"packaging",
"websocket-client"
{name = "Dr.Lt.Data", email = "dr.lt.data@gmail.com"},
]

classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)"
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
]

dependencies = [
"charset-normalizer>=3.0.0",
"GitPython",
"httpx",
"mixpanel",
"packaging",
"pathspec",
"psutil",
"pyyaml",
"questionary",
"requests",
"rich",
"tomlkit",
"typer>=0.9.0",
"typing-extensions>=4.7.0",
"websocket-client",
]

[project.optional-dependencies]
dev = [
"pre-commit",
"pytest",
"ruff",
]

[project.scripts]
Expand All @@ -54,6 +61,15 @@ Repository = "https://github.com/drip-art/comfy-cli.git"
where = ["."]
include = ["comfy_cli*"]

[tool.isort]
profile = "black"
line_length = 88
[tool.ruff]
line-length = 120
target-version = "py39"

[tool.ruff.lint]
select = [
"E4", # default
"E7", # default
"E9", # default
"F", # default
"I", # isort-like behavior (import statement sorting)
]
15 changes: 0 additions & 15 deletions requirements.txt

This file was deleted.

1 change: 0 additions & 1 deletion tests/requirements.txt

This file was deleted.

Loading
0