The-MoonTg-project / Moon-Userbot

A Simple, Fast, Customizable, Ai powered Userbot for Telegram with most easiest installation. Built in python using pyrofork(pyrogram)
GNU General Public License v3.0
18 stars 34 forks source link

[Sweep Rules] Apply consistent formatting to code #7

Closed sweep-ai[bot] closed 11 months ago

sweep-ai[bot] commented 11 months ago

PR Feedback (click)

Summary of Changes

Please review the changes and ensure that the code now follows a consistent formatting style.

sweep-ai[bot] commented 11 months ago

Rollback Files For Sweep

sweep-ai[bot] commented 11 months ago

Sandbox Executions

trunk fmt modules/admintool.py || exit 0 1/3 ✓
 ✔ Formatted modules/admintool.py
Re-checking autofixed files...

Checked 1 file
✔ No issues
Run trunk upgrade to upgrade 1 linter
trunk check --fix --print-failures modules/admintool.py 2/3 ✓
  ISSUES  
modules/admintool.py:447:39
 447:39  high  Undefined name `user`  ruff/F821
Checked 1 file
1 existing issue
if [[ $(echo "modules/admintool.py" | grep 'test.*\.py$') ]]; then PYTHONPATH=. python modules/admintool.py; else exit 0; fi 3/3 ✓
(nothing was outputted)

trunk fmt modules/afk.py || exit 0 1/3 ✓
Checked 1 file
✔ No issues
Run trunk upgrade to upgrade 1 linter
trunk check --fix --print-failures modules/afk.py 2/3 ✓
  ISSUES  
modules/afk.py:29:1
 29:1  high  Module level import not at top of file  ruff/E402
Checked 1 file
1 existing issue
if [[ $(echo "modules/afk.py" | grep 'test.*\.py$') ]]; then PYTHONPATH=. python modules/afk.py; else exit 0; fi 3/3 ✓
(nothing was outputted)

trunk fmt utils/scripts.py || exit 0 1/2 ✓
 ✔ Formatted utils/scripts.py
Re-checking autofixed files...

 ✔ Formatted utils/scripts.py
Re-checking autofixed files...

Checked 1 file
✔ No issues
Run trunk upgrade to upgrade 1 linter
trunk check --fix --print-failures utils/scripts.py 2/2 ❌ (`1`)
 ✔ Auto-fixed utils/scripts.py
Re-checking autofixed files...

  ISSUES  
utils/scripts.py:17:0
  17:0  low  Consider possible security implications associated with the subprocess module.  bandit/B404
  32:0  low  Starting a process without a shell.                                             bandit/B606
 145:0  low  subprocess call - check for execution of untrusted input.                       bandit/B603
Checked 1 file
2 existing issues
✖ 1 new issue

trunk fmt utils/scripts.py || exit 0 1/2 ✓
 ✔ Formatted utils/scripts.py
Re-checking autofixed files...

 ✔ Formatted utils/scripts.py
Re-checking autofixed files...

Checked 1 file
✔ No issues
Run trunk upgrade to upgrade 1 linter
trunk check --fix --print-failures utils/scripts.py 2/2 ❌ (`1`)
 ✔ Auto-fixed utils/scripts.py
Re-checking autofixed files...

  ISSUES  
utils/scripts.py:17:0
  17:0  low   Consider possible security implications associated with the subprocess module.  bandit/B404
  32:0  low   Starting a process without a shell.                                             bandit/B606
 142:0  high  Starting a process with a shell, possible injection detected, security issue.   bandit/B605
Checked 1 file
1 existing issue
✖ 2 new issues

trunk fmt utils/scripts.py || exit 0 1/2 ✓
 ✔ Formatted utils/scripts.py
Re-checking autofixed files...

 ✔ Formatted utils/scripts.py
Re-checking autofixed files...

Checked 1 file
✔ No issues
Run trunk upgrade to upgrade 1 linter
trunk check --fix --print-failures utils/scripts.py 2/2 ❌ (`1`)
 ✔ Auto-fixed utils/scripts.py
Re-checking autofixed files...

  ISSUES  
utils/scripts.py:17:0
  17:0  low  Consider possible security implications associated with the subprocess module.  bandit/B404
  32:0  low  Starting a process without a shell.                                             bandit/B606
 142:0  low  subprocess call - check for execution of untrusted input.                       bandit/B603
 142:0  low  Starting a process with a partial executable path                               bandit/B607
Checked 1 file
3 existing issues
✖ 1 new issue

trunk fmt utils/scripts.py || exit 0 1/2 ✓
 ✔ Formatted utils/scripts.py
Re-checking autofixed files...

 ✔ Formatted utils/scripts.py
Re-checking autofixed files...

Checked 1 file
✔ No issues
Run trunk upgrade to upgrade 1 linter
trunk check --fix --print-failures utils/scripts.py 2/2 ❌ (`1`)
 ✔ Auto-fixed utils/scripts.py
Re-checking autofixed files...

  ISSUES  
utils/scripts.py:17:0
  17:0  low  Consider possible security implications associated with the subprocess module.  bandit/B404
  32:0  low  Starting a process without a shell.                                             bandit/B606
 142:0  low  subprocess call - check for execution of untrusted input.                       bandit/B603
 142:0  low  Starting a process with a partial executable path                               bandit/B607
Checked 1 file
3 existing issues
✖ 1 new issue

trunk fmt utils/scripts.py || exit 0 1/2 ✓
 ✔ Formatted utils/scripts.py
Re-checking autofixed files...

 ✔ Formatted utils/scripts.py
Re-checking autofixed files...

Checked 1 file
✔ No issues
Run trunk upgrade to upgrade 1 linter
trunk check --fix --print-failures utils/scripts.py 2/2 ❌ (`1`)
 ✔ Auto-fixed utils/scripts.py
Re-checking autofixed files...

  ISSUES  
utils/scripts.py:17:0
  17:0  low   Consider possible security implications associated with the subprocess module.  bandit/B404
  32:0  low   Starting a process without a shell.                                             bandit/B606
 142:0  high  Starting a process with a shell, possible injection detected, security issue.   bandit/B605
Checked 1 file
1 existing issue
✖ 2 new issues

trunk fmt utils/scripts.py || exit 0 1/2 ✓
 ✔ Formatted utils/scripts.py
Re-checking autofixed files...

 ✔ Formatted utils/scripts.py
Re-checking autofixed files...

Checked 1 file
✔ No issues
Run trunk upgrade to upgrade 1 linter
trunk check --fix --print-failures utils/scripts.py 2/2 ❌ (`1`)
 ✔ Auto-fixed utils/scripts.py
Re-checking autofixed files...

  ISSUES  
utils/scripts.py:17:0
  17:0  low  Consider possible security implications associated with the subprocess module.  bandit/B404
  32:0  low  Starting a process without a shell.                                             bandit/B606
 145:0  low  subprocess call - check for execution of untrusted input.                       bandit/B603
Checked 1 file
2 existing issues
✖ 1 new issue

AbhiTheModder commented 11 months ago

Doesn't using check_output will break the code instead of run(shlex.split(

sweep-ai[bot] commented 11 months ago

🚀 Wrote Changes

Done.

AbhiTheModder commented 11 months ago

Revert back os.execv also to original

sweep-ai[bot] commented 11 months ago

🚀 Wrote Changes

I wasn't able to make changes. This could be due to an unclear request or a bug in my code. As a reminder, comments on a file only modify that file. Comments on a PR (at the bottom of the "conversation" tab) can modify the entire PR. Please try again or contact us on Discord