Skip to content

Commit b70834c

Browse files
committed
flake8
1 parent e5ff330 commit b70834c

File tree

5 files changed

+20
-15
lines changed

5 files changed

+20
-15
lines changed

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[wheel]
22

33
[flake8]
4-
exclude=.tox
4+
exclude=.tox,build,.eggs
55
max-line-length=120
66

77
[isort]

src/fluent_compiler/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from __future__ import absolute_import, unicode_literals
22

3-
43
import attr
54

65
from .compiler import compile_messages

src/fluent_compiler/utils.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,11 @@
44
import keyword
55
import re
66
import sys
7-
from datetime import date, datetime
8-
from decimal import Decimal
97

108
import six
119
from fluent.syntax.ast import Term, TermReference
1210

13-
from .errors import FluentFormatError, FluentReferenceError
14-
from .types import FluentDate, FluentDateTime, FluentDecimal, FluentFloat, FluentInt
11+
from .errors import FluentFormatError
1512

1613
TERM_SIGIL = '-'
1714
ATTRIBUTE_SEPARATOR = '.'

tests/format/test_parameterized_terms.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,10 @@ def test_with_argument(self):
4343
def test_positional_arg(self):
4444
val, errs = self.bundle.format('thing-positional-arg', {})
4545
self.assertEqual(val, 'the thing')
46-
self.assertEqual(errs, [FluentFormatError("<string>:10:32: Ignored positional arguments passed to term '-thing'")])
46+
self.assertEqual(
47+
errs,
48+
[FluentFormatError("<string>:10:32: Ignored positional arguments passed to term '-thing'")]
49+
)
4750

4851
def test_fallback(self):
4952
val, errs = self.bundle.format('thing-fallback', {})

tests/test_compiler.py

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
from markupsafe import Markup, escape
66

7-
from fluent_compiler import FluentBundle, FtlResource
8-
from fluent_compiler.compiler import messages_to_module, compile_messages
7+
from fluent_compiler import FtlResource
8+
from fluent_compiler.compiler import compile_messages
99
from fluent_compiler.errors import FluentCyclicReferenceError, FluentFormatError, FluentReferenceError
1010
from fluent_compiler.utils import SimpleNamespace
1111

@@ -565,9 +565,12 @@ def bar__attr2(message_args, errors):
565565
errors.append(FluentCyclicReferenceError('<string>:6:4: Cyclic reference in bar.attr2'))
566566
return '???'
567567
""")
568-
self.assertEqual(errs, [('foo.attr1', FluentCyclicReferenceError("<string>:3:4: Cyclic reference in foo.attr1")),
569-
('bar.attr2', FluentCyclicReferenceError("<string>:6:4: Cyclic reference in bar.attr2")),
570-
])
568+
self.assertEqual(
569+
errs,
570+
[
571+
('foo.attr1', FluentCyclicReferenceError("<string>:3:4: Cyclic reference in foo.attr1")),
572+
('bar.attr2', FluentCyclicReferenceError("<string>:6:4: Cyclic reference in bar.attr2")),
573+
])
571574

572575
def test_term_cycle_detection(self):
573576
code, errs = compile_messages_to_python("""
@@ -581,9 +584,12 @@ def cyclic_term_message(message_args, errors):
581584
)
582585
return '???'
583586
""")
584-
self.assertEqual(errs, [('cyclic-term-message',
585-
FluentCyclicReferenceError("<string>:3:1: Cyclic reference in cyclic-term-message")),
586-
])
587+
self.assertEqual(
588+
errs,
589+
[
590+
('cyclic-term-message',
591+
FluentCyclicReferenceError("<string>:3:1: Cyclic reference in cyclic-term-message")),
592+
])
587593

588594
def test_cycle_detection_with_unknown_attr(self):
589595
# unknown attributes fall back to main message, which brings

0 commit comments

Comments
 (0)