Skip to content

Commit 8b90689

Browse files
committed
Polish docs and add tests into package
1 parent 41bf268 commit 8b90689

File tree

20 files changed

+120
-109
lines changed

20 files changed

+120
-109
lines changed

.github/bump_version

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
if [[ ( -z ${1+x} ) || ( -z ${2+x} ) ]]; then
44
cat << EOF
5-
usage: $(basename ${0}) repo increment
5+
usage: $(basename "${0}") repo increment
66
77
Quick and dirty version bump script
88
If a variable "BUILD_VERSION" is set, returns that variable as is
@@ -30,7 +30,7 @@ function autoversion(){
3030
BUILD_NUMBER="0" # In the developer machine, this will build x.y.z.dev0
3131
fi
3232

33-
cd ${REPO_PATH} || exit 1
33+
cd "${REPO_PATH}" || exit 1
3434

3535
git fetch --tags 2>/dev/null
3636
last_tag=$(git tag | sort -Vr | head -1)

atlassian/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.40.0
1+
3.40.1

atlassian/bamboo.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ def project(self, project_key, expand=None, favourite=False, clover_enabled=Fals
127127

128128
def project_plans(self, project_key, start_index=0, max_results=25):
129129
"""
130-
Returns a generator with the plans in a given project
131-
:param project_key: Project key
130+
Returns a generator with the plans in a given project.
131+
:param project_key: project key
132132
:param start_index:
133133
:param max_results:
134134
:return: Generator with plans
@@ -295,7 +295,7 @@ def create_branch(
295295
:param branch_name: str new-shiny-branch
296296
:param vcs_branch: str feature/new-shiny-branch, /refs/heads/new-shiny-branch
297297
:param enabled: bool
298-
:param cleanup_enabled: bool
298+
:param cleanup_enabled: bool - enable/disable automatic cleanup of branch
299299
:return: PUT request
300300
"""
301301
resource = "plan/{plan_key}/branch/{branch_name}".format(plan_key=plan_key, branch_name=branch_name)
@@ -398,7 +398,7 @@ def latest_results(
398398
include_all_states=False,
399399
):
400400
"""
401-
Get latest Results
401+
Get the latest Results
402402
:param expand:
403403
:param favourite:
404404
:param clover_enabled:
@@ -433,7 +433,7 @@ def project_latest_results(
433433
include_all_states=False,
434434
):
435435
"""
436-
Get latest Project Results
436+
Get the latest Project Results
437437
:param project_key:
438438
:param expand:
439439
:param favourite:
@@ -533,7 +533,7 @@ def build_result(
533533

534534
def build_latest_result(self, plan_key, expand=None, include_all_states=False):
535535
"""
536-
Returns details of a latest build result
536+
Returns details of the latest build result
537537
:param expand: expands build result details on request. Possible values are: artifacts, comments, labels,
538538
Jira Issues, stages. stages expand is available only for top level plans. It allows to drill down to job results
539539
using stages.stage.results.result. All expand parameters should contain results. Result prefix.

atlassian/bitbucket/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def _get_paged(
5050
Used to get the paged data
5151
5252
:param url: string: The url to retrieve
53-
:param params: dict (default is None): The parameters
53+
:param params: dict (default is None): The parameter's
5454
:param data: dict (default is None): The data
5555
:param flags: string[] (default is None): The flags
5656
:param trailing: bool (default is None): If True, a trailing slash is added to the url

atlassian/bitbucket/cloud/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def _get_paged(
5151
Used to get the paged data
5252
5353
:param url: string: The url to retrieve
54-
:param params: dict (default is None): The parameters
54+
:param params: dict (default is None): The parameter's
5555
:param data: dict (default is None): The data
5656
:param flags: string[] (default is None): The flags
5757
:param trailing: bool (default is None): If True, a trailing slash is added to the url

atlassian/bitbucket/cloud/repositories/commits.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ def get_build(self, key):
144144

145145
def comments(self):
146146
"""
147-
Return generator object of the comments endpoint.
147+
Return generator object endpoint of the comment.
148148
API docs: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-commits/#api-repositories-workspace-repo-slug-commit-commit-comments-get
149149
"""
150150
for comment in self._get_paged("comments"):

atlassian/bitbucket/cloud/repositories/defaultReviewers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def __get_object(self, data):
1919

2020
def add(self, user):
2121
"""
22-
Adds the specified user to the repository"s list of default reviewers.
22+
Adds the specified user to the repository's list of default reviewers.
2323
2424
This method is idempotent. Adding a user a second time has no effect.
2525
@@ -34,7 +34,7 @@ def add(self, user):
3434

3535
def each(self, q=None, sort=None):
3636
"""
37-
Returns the repository"s default reviewers.
37+
Returns the repository's default reviewers.
3838
These are the users that are automatically added as reviewers on every new pull request
3939
that is created.
4040

atlassian/bitbucket/server/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def _get_paged(
3030
Used to get the paged data
3131
3232
:param url: string: The url to retrieve
33-
:param params: dict (default is None): The parameters
33+
:param params: dict (default is None): The parameter's
3434
:param data: dict (default is None): The data
3535
:param flags: string[] (default is None): The flags
3636
:param trailing: bool (default is None): If True, a trailing slash is added to the url

atlassian/confluence.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def _get_paged(
5959
Used to get the paged data
6060
6161
:param url: string: The url to retrieve
62-
:param params: dict (default is None): The parameters
62+
:param params: dict (default is None): The parameter's
6363
:param data: dict (default is None): The data
6464
:param flags: string[] (default is None): The flags
6565
:param trailing: bool (default is None): If True, a trailing slash is added to the url
@@ -210,7 +210,7 @@ def get_child_pages(self, page_id):
210210

211211
def get_page_id(self, space, title, type="page"):
212212
"""
213-
Provide content id from search result by title and space
213+
Provide content id from search result by title and space.
214214
:param space: SPACE key
215215
:param title: title
216216
:param type: type of content: Page or Blogpost. Defaults to page
@@ -250,7 +250,7 @@ def get_parent_content_title(self, page_id):
250250

251251
def get_page_space(self, page_id):
252252
"""
253-
Provide space key from content id
253+
Provide space key from content id.
254254
:param page_id: content ID
255255
:return:
256256
"""
@@ -1138,8 +1138,8 @@ def attach_content(
11381138
comment=None,
11391139
):
11401140
"""
1141-
Attach (upload) a file to a page, if it exists it will update the
1142-
automatically version the new file and keep the old one.
1141+
Attach (upload) a file to a page, if it exists it will update automatically the
1142+
version the new file and keep the old one.
11431143
:param title: The page name
11441144
:type title: ``str``
11451145
:param space: The space name
@@ -1218,8 +1218,8 @@ def attach_file(
12181218
comment=None,
12191219
):
12201220
"""
1221-
Attach (upload) a file to a page, if it exists it will update the
1222-
automatically version the new file and keep the old one.
1221+
Attach (upload) a file to a page, if it exists it will update automatically the
1222+
version the new file and keep the old one.
12231223
:param title: The page name
12241224
:type title: ``str``
12251225
:param space: The space name
@@ -2899,8 +2899,8 @@ def add_user_to_group(self, username, group_name):
28992899
"""
29002900
Add given user to a group
29012901
2902-
:param username: str
2903-
:param group_name: str
2902+
:param username: str - username of user to add to group
2903+
:param group_name: str - name of group to add user to
29042904
:return: Current state of the group
29052905
"""
29062906
url = "rest/api/2/group/user"
@@ -2919,11 +2919,11 @@ def add_space_permissions(
29192919
"""
29202920
Add permissions to a space
29212921
2922-
:param space_key: str
2923-
:param subject_type: str
2924-
:param subject_id: str
2925-
:param operation_key: str
2926-
:param operation_target: str
2922+
:param space_key: str - key of space to add permissions to
2923+
:param subject_type: str - type of subject to add permissions for
2924+
:param subject_id: str - id of subject to add permissions for
2925+
:param operation_key: str - key of operation to add permissions for
2926+
:param operation_target: str - target of operation to add permissions for
29272927
:return: Current permissions of space
29282928
"""
29292929
url = "rest/api/space/{}/permission".format(space_key)

atlassian/crowd.py

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,9 @@ def _crowd_api_url(self, api, resource):
3232

3333
def _user_change_status(self, username, active):
3434
"""
35-
Change user status
36-
37-
:params active bool
38-
35+
Change user status.
36+
:param username: str - username
37+
:param active: bool - True/False
3938
:return:
4039
"""
4140

@@ -59,12 +58,18 @@ def _user_change_status(self, username, active):
5958
)
6059

6160
def user(self, username):
61+
"""
62+
Get user information
63+
:param username:
64+
:return:
65+
"""
6266
params = {"username": username}
6367
return self.get(self._crowd_api_url("usermanagement", "user"), params=params)
6468

6569
def user_activate(self, username):
6670
"""
6771
Activate user
72+
:param username: str - username
6873
"""
6974

7075
return self._user_change_status(username, True)
@@ -116,7 +121,7 @@ def user_deactivate(self, username):
116121
def user_delete(self, username):
117122
"""
118123
Delete user
119-
124+
:param username: str - username
120125
:return:
121126
"""
122127

@@ -141,6 +146,11 @@ def group_add_user(self, username, groupname):
141146
)
142147

143148
def group_nested_members(self, group):
149+
"""
150+
Get nested members of group
151+
:param group:
152+
:return:
153+
"""
144154
params = {"groupname": group}
145155
return self.get(self._crowd_api_url("group", "nested"), params=params)
146156

0 commit comments

Comments
 (0)