Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sandy1709 committed Apr 27, 2023
1 parent 13bd710 commit aaf0869
Show file tree
Hide file tree
Showing 9 changed files with 56 additions and 58 deletions.
12 changes: 0 additions & 12 deletions .flake8

This file was deleted.

58 changes: 29 additions & 29 deletions .github/workflows/pylint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,33 @@ name: PyLint
on: [push, pull_request]

jobs:
PEP8:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
PEP8:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Setup Python
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install Python lint libraries
run: |
pip install autoflake isort black
- name: Remove unused imports and variables
run: |
autoflake --in-place --recursive --remove-all-unused-imports --remove-unused-variables --ignore-init-module-imports .
- name: lint with isort
run: |
isort .
- name: lint with black
run: |
black --exclude "exampleconfig\.py" .
# commit changes
- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: 'pylint: auto fixes'
commit_options: '--no-verify'
repository: .
commit_user_name: TgCat
commit_user_email: [email protected]
commit_author: TgCat <[email protected]>
- name: Setup Python
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install Python lint libraries
run: |
pip install autoflake isort black
- name: Remove unused imports and variables
run: |
autoflake --in-place --recursive --remove-all-unused-imports --remove-unused-variables --ignore-init-module-imports .
- name: lint with isort
run: |
isort .
- name: lint with black
run: |
black --exclude "exampleconfig\.py" .
# commit changes
- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "pylint: auto fixes"
commit_options: "--no-verify"
repository: .
commit_user_name: TgCat
commit_user_email: [email protected]
commit_author: TgCat <[email protected]>
20 changes: 10 additions & 10 deletions .isort.cfg
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[settings]
profile = black
multi_line_output = 3
include_trailing_comma = true
force_grid_wrap = 0
use_parentheses = true
ensure_newline_before_comments = true
line_length = 88
sections = FUTURE,STDLIB,THIRDPARTY,FIRSTPARTY,LOCALFOLDER
skip = .tox,__pycache__,*.pyc,venv*/*,reports,venv,env,node_modules,.env,.venv,dist
# General Settings
profile=black

# Imports
force_sort_within_sections=True
force_to_top=future, __future__
skip_glob=**/migrations/**

# Sections
sections=FUTURE,STDLIB,THIRDPARTY,FIRSTPARTY,LOCALFOLDER
Empty file removed .pylintrc
Empty file.
6 changes: 6 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"recommendations": [
"ms-python.python",
"sourcery.sourcery"
]
}
9 changes: 8 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,12 @@
"source.organizeImports": true,
"source.fixAll.flake8": true,
"sourcery.apply": true
}
},
"python.formatting.provider": "black",
"editor.formatOnSave": true,
"python.formatting.blackPath": "python3 -m black",
"python.formatting.blackArgs": [
"--config",
"isort.cfg"
]
}
1 change: 0 additions & 1 deletion userbot/assistant/inlinefm.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ def _extracted_from_get_manager_3(path, num):
for contents in sorted(lists):
zpath = os.path.join(path, contents)
if not os.path.isdir(zpath):
os.stat(zpath).st_size
if str(contents).endswith((".mp3", ".flac", ".wav", ".m4a")):
files += f"🎧`{contents}`\n"
if str(contents).endswith((".opus")):
Expand Down
4 changes: 2 additions & 2 deletions userbot/helpers/config_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@ async def set_var(event, vname, vinfo):
if error:
return error
else:
if not vinfo and vname in ["ALIVE_TEMPLATE", "PING_TEMPLATE"]:
return "Check @cat_alive"
if not vinfo:
if vname in ["ALIVE_TEMPLATE", "PING_TEMPLATE"]:
return "Check @cat_alive"
return f"Give some values which you want to save for **{vname}**"
check = vinfo.split(" ")
for i in check:
Expand Down
4 changes: 1 addition & 3 deletions userbot/helpers/functions/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,7 @@ def rand_key():


def sanga_seperator(sanga_list):
string = ""
for info in sanga_list:
string += info[info.find("\n") + 1 :]
string = "".join(info[info.find("\n") + 1 :] for info in sanga_list)
string = re.sub(r"^$\n", "", string, flags=re.MULTILINE)
name, username = string.split("Usernames**")
name = name.split("Names")[1]
Expand Down

0 comments on commit aaf0869

Please sign in to comment.