Skip to content

Commit 06c8f78

Browse files
committed
add main check
1 parent 82da38a commit 06c8f78

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

.lint.py

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
1-
import sys
2-
from os import listdir
3-
from os.path import join
1+
if __name__ == '__main__':
2+
import sys
3+
from os import listdir
4+
from os.path import join
45

5-
from pylint.lint import Run
6+
from pylint.lint import Run
67

7-
THRESHOLD = 9.75
8+
THRESHOLD = 9.75
89

9-
cogs = [join("cogs", c) for c in listdir("cogs") if c.endswith(".py")]
10-
core = [join("core", c) for c in listdir("core") if c.endswith(".py")]
10+
cogs = [join("cogs", c) for c in listdir("cogs") if c.endswith(".py")]
11+
core = [join("core", c) for c in listdir("core") if c.endswith(".py")]
1112

12-
results = Run(["bot.py", *cogs, *core], do_exit=False)
13+
results = Run(["bot.py", *cogs, *core], do_exit=False)
1314

14-
score = results.linter.stats["global_note"]
15-
if score <= THRESHOLD:
16-
sys.exit(1)
15+
score = results.linter.stats["global_note"]
16+
if score <= THRESHOLD:
17+
sys.exit(1)

0 commit comments

Comments
 (0)