Skip to content

Commit 27ffc98

Browse files
committed
Update to flake8 v7, add a dev-requirements.txt file
1 parent 9e25854 commit 27ffc98

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
lines changed

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- uses: actions/setup-python@v5
1515
with:
1616
python-version: 3.9
17-
- run: python -m pip install flake8==6 mypy==1 types-babel types-pytz
17+
- run: python -m pip install -r dev-requirements.txt
1818
- run: python -m pip install ./fluent.syntax ./fluent.runtime
1919
- run: python -m flake8
2020
- run: python -m mypy fluent.syntax/fluent fluent.runtime/fluent

dev-requirements.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
flake8 ~= 7.0
2+
mypy ~= 1.0
3+
types-babel
4+
types-pytz

fluent.syntax/fluent/syntax/ast.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def from_json(value: Any) -> Any:
3636
def scalars_equal(node1: Any, node2: Any, ignored_fields: List[str]) -> bool:
3737
"""Compare two nodes which are not lists."""
3838

39-
if type(node1) != type(node2):
39+
if type(node1) is not type(node2):
4040
return False
4141

4242
if isinstance(node1, BaseNode):

fluent.syntax/tests/syntax/test_visitor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def __init__(self, before, after):
9898

9999
def __call__(self, node):
100100
"""Perform find and replace on text values only"""
101-
if type(node) == ast.TextElement:
101+
if type(node) is ast.TextElement:
102102
node.value = node.value.replace(self.before, self.after)
103103
return node
104104

0 commit comments

Comments
 (0)