Skip to content

Commit 269d558

Browse files
Merge pull request #84 from fast-aircraft-design/add-isort
Add isort linting rules to be consistent with core repo
2 parents 707cbc5 + c861440 commit 269d558

File tree

84 files changed

+133
-128
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+133
-128
lines changed

pyproject.toml

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -138,27 +138,3 @@ exclude_lines = [
138138
"if 0:",
139139
"if __name__ = = .__main__.:",
140140
]
141-
142-
143-
# Ruff settings ================================================================
144-
[tool.ruff]
145-
line-length = 100
146-
target-version = "py310"
147-
extend-include = ["*.ipynb"]
148-
149-
[tool.ruff.lint]
150-
# Enable Pyflakes `F`) and a subset of the pycodestyle `E`) codes by default.
151-
# Unlike Flake8, Ruff doesn't enable pycodestyle warnings `W`) or
152-
# McCabe complexity `C901`) by default.
153-
select = [
154-
"E4",
155-
"E7",
156-
"E9",
157-
"F",
158-
]
159-
ignore = []
160-
# Allow fix for all enabled rules (when `--fix`) is provided.
161-
fixable = ["ALL"]
162-
unfixable = []
163-
# Allow unused variables when underscore-prefixed.
164-
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"

ruff.toml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
line-length = 100
2+
target-version = "py310"
3+
extend-include = ["*.ipynb"]
4+
5+
[lint]
6+
# Enable Pyflakes `F`) and a subset of the pycodestyle `E`) codes by default.
7+
# Unlike Flake8, Ruff doesn't enable pycodestyle warnings `W`) or
8+
# McCabe complexity `C901`) by default.
9+
select = [
10+
"E4",
11+
"E7",
12+
"E9",
13+
"F",
14+
"I", # Import sorting using isort rules
15+
]
16+
ignore = []
17+
# Allow fix for all enabled rules (when `--fix`) is provided.
18+
fixable = ["ALL"]
19+
unfixable = []
20+
# Allow unused variables when underscore-prefixed.
21+
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
22+
23+
[lint.isort] # Add optional configurations for import organization
24+
case-sensitive = true
25+
relative-imports-order = "closest-to-furthest"
26+
27+
[lint.pylint] # Add optional configurations for pylint
28+
max-args = 8
29+
30+
[lint.pep8-naming] # A list of names (or patterns) to ignore when considering pep8-naming violations. Supports glob patterns.
31+
ignore-names = [
32+
"*MTOW*",
33+
"*TOW*",
34+
"*OWE*",
35+
"*2D*",
36+
"*3D*",
37+
"*AR*",
38+
"*CL*",
39+
"*CD*",
40+
"*TAS*",
41+
"*EAS*",
42+
"*IAS*",
43+
"*CAS*",
44+
"*Mach*",
45+
"*MPI*",
46+
"I_*",
47+
]

src/fastoad_cs25/models/aerodynamics/aerodynamics_high_speed.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
# You should have received a copy of the GNU General Public License
1313
# along with this program. If not, see <https://www.gnu.org/licenses/>.
1414

15+
import fastoad.api as oad
1516
import openmdao.api as om
1617
from fastoad.module_management.constants import ModelDomain
17-
import fastoad.api as oad
1818

1919
from .constants import (
2020
SERVICE_ALPHA,

src/fastoad_cs25/models/aerodynamics/aerodynamics_landing.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,10 @@
1414
# You should have received a copy of the GNU General Public License
1515
# along with this program. If not, see <https://www.gnu.org/licenses/>.
1616

17+
import fastoad.api as oad
1718
import numpy as np
1819
import openmdao.api as om
1920
from fastoad.module_management.constants import ModelDomain
20-
import fastoad.api as oad
21-
2221
from stdatm import Atmosphere
2322

2423
from .constants import (

src/fastoad_cs25/models/aerodynamics/aerodynamics_low_speed.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,11 @@
1212
# You should have received a copy of the GNU General Public License
1313
# along with this program. If not, see <https://www.gnu.org/licenses/>.
1414

15+
import fastoad.api as oad
1516
import openmdao.api as om
1617
from fastoad.module_management.constants import ModelDomain
17-
import fastoad.api as oad
1818

1919
from .constants import (
20-
PolarType,
2120
SERVICE_ALPHA,
2221
SERVICE_CD0,
2322
SERVICE_CD_TRIM,
@@ -27,6 +26,7 @@
2726
SERVICE_OSWALD_COEFFICIENT,
2827
SERVICE_POLAR,
2928
SERVICE_REYNOLDS_COEFFICIENT,
29+
PolarType,
3030
)
3131

3232

src/fastoad_cs25/models/aerodynamics/aerodynamics_takeoff.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
# You should have received a copy of the GNU General Public License
1313
# along with this program. If not, see <https://www.gnu.org/licenses/>.
1414

15+
import fastoad.api as oad
1516
import openmdao.api as om
1617
from fastoad.module_management.constants import ModelDomain
17-
import fastoad.api as oad
1818

19-
from .constants import PolarType, SERVICE_HIGH_LIFT, SERVICE_POLAR
19+
from .constants import SERVICE_HIGH_LIFT, SERVICE_POLAR, PolarType
2020

2121

2222
@oad.RegisterOpenMDAOSystem("fastoad.aerodynamics.takeoff.legacy", domain=ModelDomain.AERODYNAMICS)

src/fastoad_cs25/models/aerodynamics/components/cd0.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
# You should have received a copy of the GNU General Public License
1313
# along with this program. If not, see <https://www.gnu.org/licenses/>.
1414

15-
import openmdao.api as om
1615
import fastoad.api as oad
16+
import openmdao.api as om
1717

1818
from ..constants import (
1919
SERVICE_CD0,

src/fastoad_cs25/models/aerodynamics/components/cd0_fuselage.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
# You should have received a copy of the GNU General Public License
1313
# along with this program. If not, see <https://www.gnu.org/licenses/>.
1414

15+
import fastoad.api as oad
1516
import numpy as np
1617
import openmdao.api as om
17-
import fastoad.api as oad
1818

1919
from .utils.friction_drag import get_flat_plate_friction_drag_coefficient
2020
from ..constants import SERVICE_CD0_FUSELAGE

src/fastoad_cs25/models/aerodynamics/components/cd0_ht.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
# You should have received a copy of the GNU General Public License
1313
# along with this program. If not, see <https://www.gnu.org/licenses/>.
1414

15+
import fastoad.api as oad
1516
import numpy as np
1617
import openmdao.api as om
17-
import fastoad.api as oad
1818

1919
from .utils.cd0_lifting_surface import (
2020
LiftingSurfaceGeometry,

src/fastoad_cs25/models/aerodynamics/components/cd0_nacelles_pylons.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
# You should have received a copy of the GNU General Public License
1313
# along with this program. If not, see <https://www.gnu.org/licenses/>.
1414

15+
import fastoad.api as oad
1516
import numpy as np
1617
import openmdao.api as om
17-
import fastoad.api as oad
1818

1919
from .utils.friction_drag import get_flat_plate_friction_drag_coefficient
2020
from ..constants import SERVICE_CD0_NACELLES_PYLONS

0 commit comments

Comments
 (0)