Skip to content

Commit

Permalink
chore: use uv and ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
star0202 committed May 11, 2024
1 parent ce0900a commit 4fcbdcf
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 15 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/ruff.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Ruff

on: [push, pull_request]

jobs:
check:
runs-on: ubuntu-latest

steps:
- name: Checkout branch
uses: actions/checkout@v4
- name: Run Ruff check
uses: chartboost/ruff-action@v1
with:
args: check

format:
runs-on: ubuntu-latest

steps:
- name: Checkout branch
uses: actions/checkout@v4
- name: Run Ruff format
uses: chartboost/ruff-action@v1
with:
args: format --check
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
tempCodeRunnerFile*
*.out
*.pyc
.venv
11 changes: 4 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@
- Visual Studio Code
- g++
- PyPy3
- Python3
- Pyhton package manager (uv, pip, etc.)

## [Tools](./tools)

In order to use python tools, you need to install dependencies in `requirements.txt`.

### [Debugger](./tools/debugger)

C++ debugging macro, requires `-DSTARCEA` flag.
Expand All @@ -19,13 +23,6 @@ Code validator for [Baekjoon Online Judge](https://www.acmicpc.net/).

Keep the `_problems` directory in the same directory with the `validator` directory.

```bash
cd validator

pip install -r requirements.txt
python validate.py <code path> # only support C++ and PyPy3
```

## [Templates](./templates)

My templates for Problem Solving and Competitive Programming.
Expand Down
14 changes: 7 additions & 7 deletions library/AutoSizedList.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,12 @@ def __getitem__(self, index: int | slice) -> T | AutoSizedList[T]:


if __name__ == "__main__":
l = AutoSizedList(lambda: AutoSizedList(int))
l[0][0] = 1
l[0][1] = 2
l[1][0] = 3
l[1][1] = 4
li = AutoSizedList(lambda: AutoSizedList(int))
li[0][0] = 1
li[0][1] = 2
li[1][0] = 3
li[1][1] = 4

print(l)
print(li)

print([id(x) for x in l])
print([id(x) for x in li])
3 changes: 2 additions & 1 deletion tools/validator/requirements.txt → requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
requests
beautifulsoup4
requests
ruff
1 change: 1 addition & 0 deletions ruff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
exclude = ["templates"]

0 comments on commit 4fcbdcf

Please sign in to comment.