Skip to content

Commit 8c39587

Browse files
committed
add pre-commit
1 parent 94ab503 commit 8c39587

File tree

7 files changed

+37
-68
lines changed

7 files changed

+37
-68
lines changed

.github/workflows/mergefile.yml

Lines changed: 0 additions & 54 deletions
This file was deleted.

.pre-commit-config.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
repos:
2+
- repo: local
3+
hooks:
4+
- id: merge_file
5+
name: merge file
6+
entry: ./merge_file.bash
7+
language: script
8+
types: [python]
9+
pass_filenames: false
10+
- repo: https://github.com/astral-sh/ruff-pre-commit
11+
rev: v0.11.7
12+
hooks:
13+
- id: ruff

aqua.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
registries:
2+
- type: standard
3+
ref: v4.353.0
4+
packages:
5+
- name: astral-sh/[email protected]

code/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ def comb(n: int, r: int, mod: int | None = None) -> int:
223223

224224

225225
# 多次元配列作成
226-
from typing import Any, List
226+
from typing import List, Any
227227

228228

229229
def create_array1(n: int, default: Any = 0) -> List[Any]:
@@ -717,8 +717,8 @@ def op(a,b):
717717
718718
vは配列の長さまたは、初期化する内容
719719
"""
720-
import math
721720
from collections import defaultdict
721+
import math
722722

723723

724724
class WeightedTreeLCA:

merge_file.bash

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,9 @@ echo "新しいmain.py作成完了"
77
# テンプレ
88
# /bin/cat python/<filename>.py >> code/main.py
99

10-
lib_path
1110
for file_name in "import.py" "math_func.py" "array_create.py" "binary_search.py" "modint.py" "standard_input.py" "yn_func.py" "grid.py" "coordinates_to_id.py" "dijkstra.py" "get_path.py" "dp.py" "coordinate_compression.py" "memo.py" "lca_weight.py" "graph.py" "unionfind.py" "potential_unionfind.py" "trie.py" "bit.py" "dis_lib.py" "alias.py" "utils.py"; do
12-
lib_path="libs/${file_name}"
13-
cat $lib_path >>code/main.py
11+
12+
cat libs/${file_name} >>code/main.py
1413
done
1514

1615
# function add_code() {
@@ -37,5 +36,6 @@ done
3736
# add_code "utils.py"
3837

3938
echo "作業完了"
39+
ruff format
4040

41-
cat code/main.py
41+
# cat code/main.py

mise.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
[tools]
2+
pre-commit = "4.2.0"
23
python = "pypy3.10-7.3.17"
34

45
[tasks]

pyproject.toml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
[tool.ruff]
22
line-length = 88
3-
select = [
4-
"C9",
5-
"E",
6-
"F",
7-
"W",
8-
"I",
9-
]
103

114
[tool.ruff.lint]
12-
ignore = ["F401", "E402", "F811", "E741"]
5+
select = ["C9", "E", "F", "W", "I"]
6+
ignore = [
7+
"F401",
8+
"E402",
9+
"F811",
10+
"E741",
11+
"F405",
12+
"F403",
13+
"I001",
14+
"E722",
15+
"E501",
16+
]

0 commit comments

Comments
 (0)