Skip to content

Commit

Permalink
feat: Added refactoring process
Browse files Browse the repository at this point in the history
  • Loading branch information
gokborayilmaz committed Aug 16, 2024
1 parent 4865fcd commit 2dacd11
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 3 deletions.
Empty file added .github/workflows/refactor.yml
Empty file.
4 changes: 2 additions & 2 deletions bump.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def write_version(version):
"""
with open('gpt_computer_assistant/__init__.py', 'r+') as file:
content = file.read()
content = re.sub(r"__version__ = '.*'", f"__version__ = '{version}'", content)
content = re.sub(r"__version__ = '.*'", f"__version__ = '{version}'", content) # fmt: off
file.seek(0)
file.write(content)

Expand All @@ -81,7 +81,7 @@ def update_version(version):
for file in files:
with open(file, 'r+') as f:
content = f.read()
content = re.sub(r' version=".*"', f' version="{version}"', content)
content = re.sub(r' version=".*"', f' version="{version}"', content) # fmt: off
f.seek(0)
f.write(content)

Expand Down
2 changes: 1 addition & 1 deletion gpt_computer_assistant/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

from .tooler import Tool

__version__ = '0.22.3'
__version__ = '0.22.3' # fmt: skip
26 changes: 26 additions & 0 deletions refactor.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import os


def install_refactor_tool():
os.system("pip install ruff==0.6.0")


def refactor():
os.system("ruff check --fix")
os.system("ruff format")


def create_commit():
os.system("git add .")
os.system("git commit -m 'refactor: Scheduled refactoring'")


def push():
os.system("git push")


if __name__ == "__main__":
install_refactor_tool()
refactor()
create_commit()
push()

0 comments on commit 2dacd11

Please sign in to comment.