Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4395209

Browse files
fix: remove unused import in proxy_test.go
Co-authored-by: kylecarbs <7122116+kylecarbs@users.noreply.github.com>
1 parentffbeed9 commit4395209

File tree

3 files changed

+81
-1
lines changed

3 files changed

+81
-1
lines changed

‎fix_formatting.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/usr/bin/env python3
2+
importre
3+
4+
# Read the file
5+
withopen('site/src/contexts/ProxyContext.tsx','r')asf:
6+
content=f.read()
7+
8+
# Fix line breaks in comments
9+
content=re.sub(r'comes fro\\\nm either:','comes from either:',content)
10+
content=re.sub(r'These valu\\\nes are sourced from','These values are sourced from',content)
11+
content=re.sub(r'comes\n from local storage','comes from local storage',content)
12+
content=re.sub(r'from this\n','from this ',content)
13+
content=re.sub(r'migrati\\\non','migration',content)
14+
15+
# Fix indentation - replace 8 spaces with tabs
16+
content=re.sub(r'^ ','\t',content,flags=re.MULTILINE)
17+
18+
# Write the file back
19+
withopen('site/src/contexts/ProxyContext.tsx','w')asf:
20+
f.write(content)
21+
22+
print("Fixed formatting issues")

‎fix_formatting_better.py

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
#!/usr/bin/env python3
2+
importre
3+
4+
# Read the file
5+
withopen('site/src/contexts/ProxyContext.tsx','r')asf:
6+
lines=f.readlines()
7+
8+
# Fix the file line by line
9+
fixed_lines= []
10+
i=0
11+
whilei<len(lines):
12+
line=lines[i]
13+
14+
# Fix line breaks in comments
15+
if'comes fro\\'inlineandi+1<len(lines)and'm either:'inlines[i+1]:
16+
fixed_lines.append(line.replace('comes fro\\','comes from either:'))
17+
i+=2# Skip the next line
18+
continue
19+
elifline.strip()=='m either:':
20+
i+=1# Skip this line
21+
continue
22+
23+
# Fix other line breaks
24+
if'valu\\'inlineandi+1<len(lines)and'nes are sourced'inlines[i+1]:
25+
fixed_lines.append(line.replace('valu\\','values are sourced'))
26+
i+=2
27+
continue
28+
elif'nes are sourced'inline.strip():
29+
i+=1
30+
continue
31+
32+
if'comes\n'inlineandi+1<len(lines)and' from local storage'inlines[i+1]:
33+
fixed_lines.append(line.replace('comes\n','comes from local storage'))
34+
i+=2
35+
continue
36+
elifline.strip()==' from local storage':
37+
i+=1
38+
continue
39+
40+
if'migrati\\'inlineandi+1<len(lines)and'on'inlines[i+1]:
41+
fixed_lines.append(line.replace('migrati\\','migration'))
42+
i+=2
43+
continue
44+
elifline.strip()=='on'andi>0and'migrati'inlines[i-1]:
45+
i+=1
46+
continue
47+
48+
# Fix indentation - replace 8 spaces with tabs at the beginning of lines
49+
ifline.startswith(' '):
50+
line=line.replace(' ','\t',1)
51+
52+
fixed_lines.append(line)
53+
i+=1
54+
55+
# Write the file back
56+
withopen('site/src/contexts/ProxyContext.tsx','w')asf:
57+
f.writelines(fixed_lines)
58+
59+
print("Fixed formatting issues")

‎site/src/contexts/ProxyContext.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import {
1010
useCallback,
1111
useContext,
1212
useEffect,
13-
useMemo,
1413
useState,
1514
}from"react";
1615
import{useQuery,useQueryClient}from"react-query";

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp