Skip to content

Commit a0926a2

Browse files
authored
Merge pull request #195 from IBM/update-linting-config
Update linting configs
2 parents 9761d08 + 1603788 commit a0926a2

File tree

4 files changed

+87
-4
lines changed

4 files changed

+87
-4
lines changed

.isort.cfg

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
[settings] ; required heading for .isort.cfg
2+
###############################################################################
3+
# Core behaviour
4+
###############################################################################
5+
profile = black ; inherit Black's own import-sorting profile
6+
line_length = 88 ; match Black's default line length
7+
multi_line_output = 3 ; vertical-hanging-indent style for long imports
8+
include_trailing_comma = true ; keep trailing commas so Black can safely re-wrap lines
9+
from_first = true ; place all "from ... import ..." blocks before plain "import ..."
10+
11+
###############################################################################
12+
# Section ordering & headings
13+
###############################################################################
14+
sections = FUTURE,STDLIB,THIRDPARTY,FIRSTPARTY,LOCALFOLDER ; five import groups in this order
15+
import_heading_future = Future ; header comment emitted above FUTURE imports (if headings enabled)
16+
import_heading_stdlib = Standard ; header for built-in Stdlib imports
17+
import_heading_thirdparty = Third-Party ; header for pip-installed packages
18+
import_heading_firstparty = First-Party ; header for internal 'mcpgateway' code
19+
import_heading_localfolder = Local ; header for ad-hoc scripts / tests in repo
20+
21+
###############################################################################
22+
# What belongs where
23+
###############################################################################
24+
known_first_party = mcpgateway ; treat "mcpgateway.*" as FIRSTPARTY
25+
known_local_folder = tests,scripts ; treat these folders as LOCALFOLDER
26+
# src_paths = src/mcpgateway ; uncomment only if package moves under src/
27+
28+
###############################################################################
29+
# Style niceties
30+
###############################################################################
31+
force_sort_within_sections = true ; always alphabetise names inside each block
32+
order_by_type = false ; don't group imports by "type vs. straight name"
33+
balanced_wrapping = true ; spread wrapped imports evenly between lines
34+
lines_between_sections = 1 ; exactly one blank line between the five groups
35+
lines_between_types = 1 ; one blank line between "import X" and "from X import ..." (if mixed)
36+
no_lines_before = LOCALFOLDER ; suppress blank line *before* the LOCALFOLDER block
37+
ensure_newline_before_comments = true ; insert a newline before any inline # comment after an import
38+
39+
###############################################################################
40+
# Ignore junk we never want to touch
41+
###############################################################################
42+
extend_skip = .md,.json,.yaml,.yml,dist,build,.venv,.tox,*.tmp,*.bak ; files & dirs to never rewrite
43+
skip_glob = **/__init__.py ; leave namespace init files alone
44+
45+
# ---- Optional CI toggles ----------------------------------------------------
46+
# check_only = true ; dry-run mode: exit non-zero if files would change
47+
# verbose = true ; print every file name processed
48+
# case_sensitive = true ; treat upper/lowercase differences as significant

.pylintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ msg-template=
504504
#output-format=
505505

506506
# Tells whether to display a full report or only the messages.
507-
reports=no
507+
reports=yes
508508

509509
# Activate the evaluation score.
510510
score=yes

DCO.txt

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
Developer Certificate of Origin
2+
Version 1.1
3+
4+
Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
5+
6+
Everyone is permitted to copy and distribute verbatim copies of this
7+
license document, but changing it is not allowed.
8+
9+
10+
Developer's Certificate of Origin 1.1
11+
12+
By making a contribution to this project, I certify that:
13+
14+
(a) The contribution was created in whole or in part by me and I
15+
have the right to submit it under the open source license
16+
indicated in the file; or
17+
18+
(b) The contribution is based upon previous work that, to the best
19+
of my knowledge, is covered under an appropriate open source
20+
license and I have the right under that license to submit that
21+
work with modifications, whether created in whole or in part
22+
by me, under the same open source license (unless I am
23+
permitted to submit under a different license), as indicated
24+
in the file; or
25+
26+
(c) The contribution was provided directly to me by some other
27+
person who certified (a), (b) or (c) and I have not modified
28+
it.
29+
30+
(d) I understand and agree that this project and the contribution
31+
are public and that a record of the contribution (including all
32+
personal information I submit with it, including my sign-off) is
33+
maintained indefinitely and may be redistributed consistent with
34+
this project or the open source license(s) involved.

pyproject.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -220,9 +220,10 @@ line-length = 200
220220
target-version = ["py310", "py311", "py312"]
221221
include = "\\.pyi?$"
222222

223-
[tool.isort]
224-
profile = "black"
225-
multi_line_output = 3
223+
# Configured in .isort.cfg instead
224+
# [tool.isort]
225+
# profile = "black"
226+
# multi_line_output = 3
226227

227228
[tool.mypy]
228229
# Target Python version

0 commit comments

Comments
 (0)