File tree Expand file tree Collapse file tree 3 files changed +27
-2
lines changed
Expand file tree Collapse file tree 3 files changed +27
-2
lines changed Original file line number Diff line number Diff line change 1+ name : Lint Database
2+ on : [push, pull_request]
3+
4+ jobs :
5+ build :
6+ runs-on : ubuntu-latest
7+ name : Lint Database
8+ steps :
9+ - uses : actions/checkout@v2
10+ - uses : actions/setup-node@v3
11+ with :
12+ node-version : 16
13+ - uses : actions/setup-python@v4
14+ with :
15+ python-version : ' 3.10'
16+ - run : npm i -g wrangler
17+ - run : python3 make.py
Original file line number Diff line number Diff line change 247247肆意流淌吧
248248让世间到处盛开 无法定格的花
249249才是盛夏
250- -- 举烛 《夏日降雨禁令》, 2022
250+ -- 举烛 《夏日降雨禁令》, 2022
Original file line number Diff line number Diff line change @@ -45,8 +45,16 @@ def print_file_size(filename: str):
4545
4646
4747def load ():
48+ with open (FILENAMES .SOURCE_DATABASE , "rb" ) as f :
49+ if b'\r ' in f .read ():
50+ print (colored ('red' , 'Error:' ), '数据库文件中不得包含 CR (\\ r) 字符' )
51+ sys .exit (- 2 )
4852 with open (FILENAMES .SOURCE_DATABASE , encoding = 'utf-8' ) as f :
49- database = f .read ().strip ()
53+ database = f .read ()
54+ if not database .endswith ('\n ' ):
55+ print (colored ('red' , 'Error:' ), '数据库文件应该以 LF (\\ n) 结尾' )
56+ sys .exit (- 2 )
57+ database = database .strip ()
5058 database = [i .strip () for i in database .split ('-' * 30 )]
5159 if (database [0 ] == '' ) or (database [- 1 ] == '' ):
5260 print (colored ('red' , 'Error:' ), '遇到了空的歌词块 (quoteblock)' )
You can’t perform that action at this time.
0 commit comments