Skip to content

Commit 2c42d19

Browse files
authored
style: apply ignition-devs styleguide (#22)
1 parent 79c8df4 commit 2c42d19

8 files changed

Lines changed: 19 additions & 53 deletions

File tree

.devcontainer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
}
2020
},
2121
"postCreateCommand": {
22-
"pre-commit": "pre-commit install --hook-type commit-msg --hook-type pre-commit --hook-type pre-push",
22+
"pre-commit": "pre-commit install --hook-type pre-commit --hook-type commit-msg --hook-type pre-push",
2323
"dev-requirements": "python2 -m pip install --requirement requirements.txt"
2424
}
25-
}
25+
}

.editorconfig

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,17 @@ root = true
66
[*]
77
charset = utf-8
88
end_of_line = lf
9+
indent_style = space
910
trim_trailing_whitespace = true
1011

1112
[*.{json}]
1213
indent_size = 2
13-
indent_style = space
1414
insert_final_newline = false
1515

1616
[*.{md,toml,yaml,yml}]
1717
indent_size = 2
18-
indent_style = space
1918
insert_final_newline = true
2019

21-
[*.{py,pyi}]
20+
[*.{ini,py,pyi}]
2221
indent_size = 4
23-
indent_style = space
24-
insert_final_newline = true
22+
insert_final_newline = true

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1818
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1919
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2020
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21-
SOFTWARE.
21+
SOFTWARE.

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[metadata]
22
name = java_api
33
version = 17.26.0
4-
description = Java API Specification for ignition-api
4+
description = Java API Specification
55
long_description = file: README.md
66
long_description_content_type = text/markdown
77
url = https://github.com/ignition-devs/java-api

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# pylint: skip-file
2-
"""Java API Specification."""
2+
"""Java API Specification"""
33

44
from setuptools import setup
55

stubs/pyproject.toml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[build-system]
22
build-backend = "setuptools.build_meta"
33
requires = [
4-
"setuptools",
4+
"setuptools>=61.2",
55
]
66

77
[project]
@@ -35,15 +35,13 @@ classifiers = [
3535
"Typing :: Stubs Only",
3636
"Typing :: Typed",
3737
]
38-
urls.Homepage = "https://github.com/ignition-devs/java-api"
3938
urls.Documentation = "https://docs.oracle.com/en/java/javase/17/docs/api/index.html"
4039
urls.Funding = "https://github.com/sponsors/cesarcoatl"
40+
urls.Homepage = "https://github.com/ignition-devs/java-api"
4141
urls.Source = "https://github.com/ignition-devs/java-api/tree/main"
4242
urls.Tracker = "https://github.com/ignition-devs/java-api/issues"
4343

4444
[tool.setuptools]
4545
include-package-data = true
4646
package-dir = { "" = "stubs" }
47-
48-
[tool.setuptools.package-data]
49-
"*" = [ "*.pyi", "py.typed" ]
47+
package-data."*" = [ "*.pyi", "py.typed" ]

stubs/tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ description = run type check on code base
1111
base_python = python3.12
1212
skip_install = true
1313
deps =
14-
mypy[python2]@ git+https://github.com/coatl-dev/mypy.git@v0.971
14+
mypy[python2] @ git+https://github.com/coatl-dev/mypy.git@v0.971
1515
commands =
1616
mypy stubs
1717

tox.ini

Lines changed: 7 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ description = run type check on code base
1717
base_python = python3.12
1818
skip_install = true
1919
deps =
20-
mypy[python2]@ git+https://github.com/coatl-dev/mypy.git@v0.971
20+
mypy[python2] @ git+https://github.com/coatl-dev/mypy.git@v0.971
2121
commands =
2222
mypy --install-types --non-interactive src
2323

@@ -26,60 +26,30 @@ description = generate stubs
2626
base_python = python3.12
2727
skip_install = true
2828
deps =
29-
mypy[python2]@ git+https://github.com/coatl-dev/mypy.git@v0.971
29+
mypy[python2] @ git+https://github.com/coatl-dev/mypy.git@v0.971
3030
commands =
3131
stubgen --export-less --output=stubs{/}stubs src
3232

33-
[testenv:style]
34-
description = apply style
35-
base_python = python3.12
36-
skip_install = true
37-
deps =
38-
black
39-
docformatter
40-
flake8@ git+https://github.com/coatl-dev/flake8.git@5.0.4
41-
isort
42-
pydoclint
43-
pydocstyle
44-
sort-all
45-
unimport
46-
commands =
47-
python -c \
48-
"import pathlib, subprocess; \
49-
files = [str(p) for p in pathlib.Path('src').rglob('*.py')]; \
50-
subprocess.run(['sort-all'] + files, check=True)"
51-
black --quiet src
52-
unimport src
53-
isort --settings-file=tox.ini src
54-
docformatter \
55-
--in-place \
56-
--wrap-summaries 72 \
57-
--close-quotes-on-newline \
58-
--recursive \
59-
src
60-
flake8 --select=DOC --config=tox.ini src
61-
pydocstyle --config=tox.ini src{/}system
62-
6333
[docformatter]
34+
close-quotes-on-newline = true
6435
in-place = true
6536
wrap-summaries = 72
66-
close-quotes-on-newline = true
6737

6838
[flake8]
39+
arg-type-hints-in-docstring = False
40+
arg-type-hints-in-signature = False
41+
check-return-types = False
6942
ignore = DOC202, E741, F821
7043
max-complexity = 10
7144
max-doc-length = 72
7245
max-line-length = 120
7346
style = google
74-
arg-type-hints-in-docstring = False
75-
arg-type-hints-in-signature = False
76-
check-return-types = False
7747

7848
[isort]
7949
extra_standard_library = typing
8050
profile = black
8151
py_version = 27
8252

8353
[pydocstyle]
84-
convention = google
8554
add_ignore = D101, D102, D104, D105, D106, D107, D205, D415
55+
convention = google

0 commit comments

Comments
 (0)