Skip to content

Commit f60dbb8

Browse files
[Documentation][system] Standarize docstrings in module_utils/system.py (#1363)
* Modify google style to numpy * Add changelog fragment * Standarize numpy style * Standarize numpy style * Added year * Update 1363-update-docstring-system.yml --------- Co-authored-by: Fernando Flores <[email protected]>
1 parent 8792772 commit f60dbb8

File tree

2 files changed

+24
-13
lines changed

2 files changed

+24
-13
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
trivial:
2+
- system - Updated docstrings to numpy style for visual aid to developers.
3+
(https://github.com/ansible-collections/ibm_zos_core/pull/1363).

plugins/module_utils/system.py

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) IBM Corporation 2020, 2023
1+
# Copyright (c) IBM Corporation 2020, 2024
22
# Licensed under the Apache License, Version 2.0 (the "License");
33
# you may not use this file except in compliance with the License.
44
# You may obtain a copy of the License at
@@ -34,19 +34,23 @@
3434

3535

3636
def is_posix():
37-
""" Determine if the system is POSIX certified or compliant
37+
"""Determine if the system is POSIX certified or compliant.
3838
39-
Returns:
40-
bool -- Whether the system is POSIX
39+
Returns
40+
-------
41+
bool
42+
Whether the system is POSIX.
4143
"""
4244
return OS_NAME == "posix"
4345

4446

4547
def is_nix():
46-
""" Determine if the system is a variant of Unix, supported by Python.
48+
"""Determine if the system is a variant of Unix, supported by Python.
4749
48-
Returns:
49-
bool -- Whether the system is Unix-based
50+
Returns
51+
-------
52+
bool
53+
Whether the system is Unix-based.
5054
"""
5155
if not is_posix():
5256
return False
@@ -58,19 +62,23 @@ def is_nix():
5862

5963

6064
def is_win():
61-
""" Determine if the system is a Windows platform
65+
"""Determine if the system is a Windows platform.
6266
63-
Returns:
64-
bool -- Whether the system is Windows
67+
Returns
68+
-------
69+
bool
70+
Whether the system is Windows.
6571
"""
6672
return "win32" in platform().lower() or OS_NAME == "nt"
6773

6874

6975
def is_zos():
70-
""" Determine if the system is a z/OS distribution
76+
"""Determine if the system is a z/OS distribution.
7177
72-
Returns:
73-
bool -- Whether the system is z/OS
78+
Returns
79+
-------
80+
bool
81+
Whether the system is z/OS.
7482
"""
7583
is_zos_unix = is_posix() and not is_nix()
7684
return is_zos_unix and SYS_PLATFORM == "zos"

0 commit comments

Comments
 (0)