File tree Expand file tree Collapse file tree 11 files changed +36
-60
lines changed Expand file tree Collapse file tree 11 files changed +36
-60
lines changed Original file line number Diff line number Diff line change 1
1
[flake8]
2
+ exclude =.tox
2
3
max-line-length =120
Original file line number Diff line number Diff line change 43
43
python -m pip install .
44
44
- run : ./runtests.py
45
45
working-directory : ./fluent.runtime
46
- lint :
47
- runs-on : ubuntu-latest
48
- steps :
49
- - uses : actions/checkout@v4
50
- - uses : actions/setup-python@v5
51
- with :
52
- python-version : 3.9
53
- - name : Install dependencies
54
- working-directory : ./fluent.runtime
55
- run : |
56
- python -m pip install wheel
57
- python -m pip install --upgrade pip
58
- python -m pip install .
59
- python -m pip install flake8==6 mypy==1 types-babel types-pytz
60
- - name : Install latest fluent.syntax
61
- working-directory : ./fluent.syntax
62
- run : python -m pip install .
63
- - run : python -m flake8
64
- working-directory : ./fluent.runtime
65
- - run : python -m mypy fluent/
66
- working-directory : ./fluent.runtime
Original file line number Diff line number Diff line change 38
38
python -m pip install .
39
39
- run : ./runtests.py
40
40
working-directory : ./fluent.syntax
41
- lint :
42
- runs-on : ubuntu-latest
43
- steps :
44
- - uses : actions/checkout@v4
45
- - uses : actions/setup-python@v5
46
- with :
47
- python-version : 3.9
48
- - name : Install dependencies
49
- working-directory : ./fluent.syntax
50
- run : |
51
- python -m pip install --upgrade pip
52
- python -m pip install .
53
- python -m pip install flake8==6 mypy==1
54
- - run : python -m flake8
55
- working-directory : ./fluent.syntax
56
- - run : python -m mypy fluent/
57
- working-directory : ./fluent.syntax
Original file line number Diff line number Diff line change
1
+ name : lint
2
+
3
+ on :
4
+ push :
5
+ branches :
6
+ - main
7
+ pull_request :
8
+
9
+ jobs :
10
+ lint :
11
+ runs-on : ubuntu-latest
12
+ steps :
13
+ - uses : actions/checkout@v4
14
+ - uses : actions/setup-python@v5
15
+ with :
16
+ python-version : 3.9
17
+ - run : python -m pip install flake8==6 mypy==1 types-babel types-pytz
18
+ - run : python -m pip install ./fluent.syntax ./fluent.runtime
19
+ - run : python -m flake8
20
+ - run : python -m mypy fluent.syntax/fluent fluent.runtime/fluent
Original file line number Diff line number Diff line change 34
34
# Add any paths that contain templates here, relative to this directory.
35
35
templates_path = ['_templates' ]
36
36
37
+
37
38
# Add src_dir/docs/_templates in a hook as we only have the src_dir then.
38
39
def setup (app ):
39
40
app .connect ('config-inited' , add_templates )
40
41
42
+
41
43
def add_templates (app , config ):
42
44
config .templates_path .insert (0 , f'{ app .srcdir } /_templates' )
43
45
46
+
44
47
# List of patterns, relative to source directory, that match files and
45
48
# directories to ignore when looking for source files.
46
49
# This pattern also affects html_static_path and html_extra_path.
Original file line number Diff line number Diff line change @@ -4,10 +4,6 @@ version=2.0
4
4
[bdist_wheel]
5
5
universal =1
6
6
7
- [flake8]
8
- exclude =.tox
9
- max-line-length =120
10
-
11
7
[isort]
12
8
line_length =120
13
9
skip_glob =.tox
Original file line number Diff line number Diff line change @@ -4,10 +4,6 @@ version=0.4.0
4
4
[bdist_wheel]
5
5
universal =1
6
6
7
- [flake8]
8
- exclude =.tox
9
- max-line-length =120
10
-
11
7
[isort]
12
8
line_length =120
13
9
skip_glob =.tox
Original file line number Diff line number Diff line change @@ -4,10 +4,6 @@ version=0.19.0
4
4
[bdist_wheel]
5
5
universal =1
6
6
7
- [flake8]
8
- exclude =.tox
9
- max-line-length =120
10
-
11
7
[isort]
12
8
line_length =120
13
9
skip_glob =.tox
Original file line number Diff line number Diff line change 1
1
#!/usr/bin/python
2
2
3
3
import sys
4
-
5
- sys .path .append ('./' )
6
4
import codecs
7
5
from fluent .syntax import parse , serialize
8
6
7
+ sys .path .append ("./" )
8
+
9
9
10
10
def read_file (path ):
11
- with codecs .open (path , 'r' , encoding = ' utf-8' ) as file :
11
+ with codecs .open (path , "r" , encoding = " utf-8" ) as file :
12
12
text = file .read ()
13
13
return text
14
14
@@ -17,7 +17,8 @@ def pretty_print(fileType, data):
17
17
ast = parse (data )
18
18
print (serialize (ast ))
19
19
20
+
20
21
if __name__ == "__main__" :
21
- file_type = ' ftl'
22
+ file_type = " ftl"
22
23
f = read_file (sys .argv [1 ])
23
24
pretty_print (file_type , f )
Original file line number Diff line number Diff line change 1
1
#!/usr/bin/python
2
2
3
3
import sys
4
-
5
- sys .path .append ('./' )
6
4
import codecs
7
5
from fluent .syntax import parse
8
6
import json
9
7
8
+ sys .path .append ('./' )
9
+
10
10
11
11
def read_file (path ):
12
12
with codecs .open (path , 'r' , encoding = 'utf-8' ) as file :
Original file line number Diff line number Diff line change 2
2
3
3
import sys
4
4
import json
5
-
6
- sys .path .append ('./' )
7
5
import codecs
8
6
from fluent .syntax import ast , serialize
9
7
8
+ sys .path .append ("./" )
9
+
10
10
11
11
def read_json (path ):
12
- with codecs .open (path , 'r' , encoding = ' utf-8' ) as file :
12
+ with codecs .open (path , "r" , encoding = " utf-8" ) as file :
13
13
return json .load (file )
14
14
15
15
16
16
def pretty_print (fileType , data ):
17
17
resource = ast .from_json (data )
18
18
print (serialize (resource ))
19
19
20
+
20
21
if __name__ == "__main__" :
21
- file_type = ' ftl'
22
+ file_type = " ftl"
22
23
f = read_json (sys .argv [1 ])
23
24
pretty_print (file_type , f )
You can’t perform that action at this time.
0 commit comments