Skip to content

Commit 669bc5b

Browse files
Merge pull request #63 from python-thread/style/pep8
Style: Conforming to PEP8
2 parents af349cc + cf9dfda commit 669bc5b

File tree

17 files changed

+1080
-1088
lines changed

17 files changed

+1080
-1088
lines changed

.github/CODESTYLE.md

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -19,39 +19,39 @@ Listed is a example class used demonstrate general rules you should follow throu
1919

2020
```python
2121
class ExampleClass:
22-
"""
23-
ExampleClass
24-
------------
25-
Example class for CODESTYLE.md
26-
"""
27-
# ^^^ reST Docstring Format
28-
29-
_private_attribute : int # private attributes begin with a lowercase
30-
public_attribute : int # type hint for integer is defined here
31-
32-
def __init__(
33-
self,
34-
public_attribute: int # type hint for parameters
35-
) -> None: # the expected return value of method
3622
"""
37-
Initializes a ExampleClass
38-
39-
Parameters
40-
----------
41-
:param public_attribute: example attribute
42-
"""
43-
self.public_attribute = public_attribute
44-
self.private_attribute = square(public_attribute)
45-
46-
def square(self, value: int) -> int:
47-
"""
48-
Example method that square roots a value
49-
50-
Parameters
51-
----------
52-
:param value: value that you want squared
23+
ExampleClass
24+
------------
25+
Example class for CODESTYLE.md
5326
"""
54-
return value**2
27+
# ^^^ reST Docstring Format
28+
29+
_private_attribute : int # private attributes begin with a lowercase
30+
public_attribute : int # type hint for integer is defined here
31+
32+
def __init__(
33+
self,
34+
public_attribute: int # type hint for parameters
35+
) -> None: # the expected return value of method
36+
"""
37+
Initializes a ExampleClass
38+
39+
Parameters
40+
----------
41+
:param public_attribute: example attribute
42+
"""
43+
self.public_attribute = public_attribute
44+
self.private_attribute = square(public_attribute)
45+
46+
def square(self, value: int) -> int:
47+
"""
48+
Example method that square roots a value
49+
50+
Parameters
51+
----------
52+
:param value: value that you want squared
53+
"""
54+
return value**2
5555
```
5656

5757

@@ -87,7 +87,7 @@ Currently, documentation for this project resides in markdown files.
8787
- Use of HTML is permitted
8888
- [reference style links](https://www.markdownguide.org/basic-syntax/#reference-style-links) are not required by are appreciated
8989
- Exceedingly long lines are to be broken
90-
- The indents are to be two spaces
90+
- The indents are to be 4 spaces
9191

9292
```markdown
9393
<!--example markdown document-->

ruff.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
indent-width = 2
2-
31
[format]
42
# Exclude commonly ignored directories.
53
exclude = [

src/thread/__init__.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@
3838

3939
# Wildcard Export
4040
__all__ = [
41-
'Thread',
42-
'ParallelProcessing',
43-
'threaded',
44-
'processor',
45-
'types',
46-
'exceptions',
47-
'Settings',
48-
'__version__',
41+
'Thread',
42+
'ParallelProcessing',
43+
'threaded',
44+
'processor',
45+
'types',
46+
'exceptions',
47+
'Settings',
48+
'__version__',
4949
]

src/thread/__main__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
from .cli import app
33

44
if __name__ == '__main__':
5-
app(prog_name='thread')
5+
app(prog_name='thread')

src/thread/_types.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@
1616

1717
# Variable Types
1818
ThreadStatus = Literal[
19-
'Idle',
20-
'Running',
21-
'Invoking hooks',
22-
'Completed',
23-
'Errored',
24-
'Kill Scheduled',
25-
'Killed',
19+
'Idle',
20+
'Running',
21+
'Invoking hooks',
22+
'Completed',
23+
'Errored',
24+
'Kill Scheduled',
25+
'Killed',
2626
]
2727

2828

src/thread/cli.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
try:
2-
import importlib
2+
import importlib
33

4-
thread_cli = importlib.import_module('thread-cli')
5-
app = thread_cli.app
4+
thread_cli = importlib.import_module('thread-cli')
5+
app = thread_cli.app
66
except ModuleNotFoundError:
77

8-
def app(prog_name='thread'):
9-
print('thread-cli not found, please install it with `pip install thread-cli`')
10-
exit(1)
8+
def app(prog_name='thread'):
9+
print('thread-cli not found, please install it with `pip install thread-cli`')
10+
exit(1)

0 commit comments

Comments
 (0)