Skip to content

Commit

Permalink
fix flake8 (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
vb64 authored Dec 2, 2023
1 parent 34318d0 commit a206cf9
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 13 deletions.
2 changes: 2 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[flake8]
max_line_length = 120
4 changes: 2 additions & 2 deletions .github/workflows/py3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ jobs:
- name: flake8
run: |
flake8 --count --show-source --statistics --max-line-length=120 pipeline_integrity
flake8 --count --show-source --statistics --max-line-length=120 tests/test
flake8 --count --show-source --statistics pipeline_integrity
flake8 --count --show-source --statistics tests/test
- name: pylint
run: |
Expand Down
2 changes: 1 addition & 1 deletion makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ SOURCE = pipeline_integrity
TESTS = tests
LOCALE_ASME = $(SOURCE)/method/asme/locale

FLAKE8 = $(PYTHON) -m flake8 --max-line-length=120
FLAKE8 = $(PYTHON) -m flake8
PYLINT = $(PYTHON) -m pylint
PYLINT2 = $(PYLINT) --rcfile .pylintrc2
PYTEST = $(PTEST) --cov=$(SOURCE) --cov-report term:skip-covered
Expand Down
16 changes: 8 additions & 8 deletions pipeline_integrity/method/asme/b31g_2012.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def get_stress_fail(self):
self
),

'\n', self.explain_stress_fail(s_f, m_val, s_p),
'\n', self.explain_stress_fail(s_f, m_val, s_p),
])

return s_p
Expand All @@ -136,13 +136,13 @@ def get_stress_fail(self):
def explain_stress_fail(self, s_f, m_val, s_p):
"""Return text that explain stress_fail calculation."""
return "stress_fail = {} * (1 - 0.85 * ({} / {})) / (1 - 0.85 * ({} / {}) / {}) = {}.".format(
round(s_f, EXPL_ROUND),
round(self.anomaly.depth, EXPL_ROUND),
round(self.anomaly.pipe.wallthickness, EXPL_ROUND),
round(self.anomaly.depth, EXPL_ROUND),
round(self.anomaly.pipe.wallthickness, EXPL_ROUND),
round(m_val, EXPL_ROUND),
round(s_p, EXPL_ROUND),
round(s_f, EXPL_ROUND),
round(self.anomaly.depth, EXPL_ROUND),
round(self.anomaly.pipe.wallthickness, EXPL_ROUND),
round(self.anomaly.depth, EXPL_ROUND),
round(self.anomaly.pipe.wallthickness, EXPL_ROUND),
round(m_val, EXPL_ROUND),
round(s_p, EXPL_ROUND),
)

def get_stress_fail_mod(self):
Expand Down
4 changes: 2 additions & 2 deletions tests/docker/test.cmd
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
python -m flake8 --max-line-length=120 pipeline_integrity
python -m flake8 --max-line-length=120 tests/test
python -m flake8 pipeline_integrity
python -m flake8 tests/test
python -m pydocstyle pipeline_integrity
python -m pydocstyle --match='.*\.py' tests/test
python -m pylint --rcfile .pylintrc2 pipeline_integrity
Expand Down

0 comments on commit a206cf9

Please sign in to comment.