Skip to content

Commit 5cdd16c

Browse files
committed
flake8/pylint -> ruff
1 parent 1e72320 commit 5cdd16c

File tree

5 files changed

+56
-216
lines changed

5 files changed

+56
-216
lines changed

Taskfile.yml

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,7 @@ tasks:
1010
desc: Lints the code and reports on issues.
1111
cmds:
1212
- poetry run black --check lasso
13-
# E501:
14-
# We disable too long lines in ArrayType since the docstrings for arrays
15-
# must be behind the arrays for sphinx, thus lines cannot be shortened.
16-
# Anyhow if you find any way to change feel free to submit a PR.
17-
# E203:
18-
# We ignore E203 since allowing whitespace around ':' makes slicing
19-
# more understandable when doing complex slicing.
20-
# W503:
21-
# Allowing operators such as '+' after a new line instead of putting it
22-
# on the previous one, complex condition chains are more understandable.
23-
- |
24-
poetry run flake8 lasso \
25-
--ignore="E203,W503" \
26-
--per-file-ignores="lasso/dyna/ArrayType.py:E501" \
27-
--show-source \
28-
--statistics \
29-
--count
30-
- poetry run pylint lasso
13+
- poetry run ruff check
3114

3215
build:
3316
desc: Builds the python package

lasso/dyna/femzip_mapper.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -234,12 +234,6 @@
234234
(FemzipArrayType.STRAIN_XY, FemzipVariableCategory.SOLID): {ArrayType.element_solid_strain},
235235
(FemzipArrayType.STRAIN_YZ, FemzipVariableCategory.SOLID): {ArrayType.element_solid_strain},
236236
(FemzipArrayType.STRAIN_XZ, FemzipVariableCategory.SOLID): {ArrayType.element_solid_strain},
237-
(FemzipArrayType.STRAIN_X, FemzipVariableCategory.SOLID): {ArrayType.element_solid_strain},
238-
(FemzipArrayType.STRAIN_Y, FemzipVariableCategory.SOLID): {ArrayType.element_solid_strain},
239-
(FemzipArrayType.STRAIN_Z, FemzipVariableCategory.SOLID): {ArrayType.element_solid_strain},
240-
(FemzipArrayType.STRAIN_XY, FemzipVariableCategory.SOLID): {ArrayType.element_solid_strain},
241-
(FemzipArrayType.STRAIN_YZ, FemzipVariableCategory.SOLID): {ArrayType.element_solid_strain},
242-
(FemzipArrayType.STRAIN_XZ, FemzipVariableCategory.SOLID): {ArrayType.element_solid_strain},
243237
# AIRBAG
244238
(FemzipArrayType.AIRBAG_STATE_GEOM, FemzipVariableCategory.CPM_AIRBAG): {
245239
ArrayType.airbag_n_active_particles,

lasso/dyna/lsda_py3.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def writecd(self, dir):
105105
length = self.lengthsize + self.commandsize + len(dir)
106106
s = struct.pack(self.lcunpack, length, Lsda.CD)
107107
self.fp.write(s)
108-
if type(dir) is str:
108+
if isinstance(dir, str):
109109
self.fp.write(bytes(dir, "utf-8"))
110110
else:
111111
self.fp.write(dir)
@@ -118,7 +118,7 @@ def writestentry(self, r):
118118
)
119119
s = struct.pack(self.lcunpack, length, Lsda.VARIABLE)
120120
self.fp.write(s)
121-
if type(r.name) is str:
121+
if isinstance(r.name, str):
122122
self.fp.write(bytes(r.name, "utf-8"))
123123
else:
124124
self.fp.write(r.name)
@@ -525,7 +525,7 @@ def cd(self, path, create=2): # change CWD
525525
self.cwd = self.root
526526
# path = string.split(path,"/")
527527
# print(type(path))
528-
if type(path) is bytes:
528+
if isinstance(path, bytes):
529529
path = str(path, "utf-8").split("/")
530530
else:
531531
path = path.split("/")

poetry.lock

Lines changed: 51 additions & 158 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)