Skip to content

Commit eec8d6a

Browse files
authored
Merge pull request #961 from bhavberi/linting
Fixed all the issues in linting github action
2 parents ca480c8 + c449e7f commit eec8d6a

File tree

7 files changed

+11
-14
lines changed

7 files changed

+11
-14
lines changed

.github/workflows/python-app.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
pip install -r requirements-dev.txt
4343
- name: Run Pylint
4444
run: |
45-
pylint office365
45+
pylint --disable=too-many-positional-arguments office365
4646
4747
pytest:
4848
runs-on: ubuntu-latest

office365/runtime/client_object_collection.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,12 @@ def remove_child(self, client_object):
8181

8282
def __iter__(self):
8383
# type: () -> Iterator[T]
84-
for item in self._data:
85-
yield item
84+
yield from self._data
8685
if self._paged_mode:
8786
while self.has_next:
8887
self._get_next().execute_query()
8988
next_items = self._data[self._current_pos :]
90-
for next_item in next_items:
91-
yield next_item
89+
yield from next_items
9290

9391
def __len__(self):
9492
# type: () -> int

office365/sharepoint/listitems/listitem.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ def system_update(self):
344344

345345
def _after_system_update(result):
346346
# type: (ClientResult[ClientValueCollection[ListItemFormUpdateValue]]) -> None
347-
has_any_error = any([item.HasException for item in result.value])
347+
has_any_error = any(item.HasException for item in result.value)
348348
if has_any_error:
349349
raise ValueError("Update ListItem failed")
350350

office365/sharepoint/lists/list.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ def get_list_data_as_stream(
425425
:param ClientResult[dict] return_type: The return type.
426426
"""
427427
if return_type is None:
428-
return_type = ClientResult(context, dict())
428+
return_type = ClientResult(context, {})
429429
payload = {
430430
"listFullUrl": list_full_url,
431431
"parameters": parameters,
@@ -451,7 +451,7 @@ def get_onedrive_list_data_as_stream(context, parameters=None, return_type=None)
451451
:param ClientResult[dict] return_type: The return type.
452452
"""
453453
if return_type is None:
454-
return_type = ClientResult(context, dict())
454+
return_type = ClientResult(context, {})
455455
payload = {
456456
"parameters": parameters,
457457
}
@@ -776,7 +776,7 @@ def render_list_data_as_stream(
776776
:param int render_options: Specifies the type of output to return.
777777
:param bool expand_groups: Specifies whether to expand the grouping or not.
778778
"""
779-
return_type = ClientResult(self.context, dict())
779+
return_type = ClientResult(self.context, {})
780780
if view_xml is None:
781781
view_xml = "<View/>"
782782
payload = {

office365/sharepoint/navigation/node.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
from typing import TYPE_CHECKING, Optional
1+
from typing import Optional
22

33
from office365.runtime.paths.resource_path import ResourcePath
44
from office365.sharepoint.entity import Entity
5+
from office365.sharepoint.navigation.node_collection import NavigationNodeCollection
56
from office365.sharepoint.translation.user_resource import UserResource
67

7-
if TYPE_CHECKING:
8-
from office365.sharepoint.navigation.node_collection import NavigationNodeCollection
9-
108

119
class NavigationNode(Entity):
1210
"""

office365/sharepoint/webs/web.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ def get_list_data_as_stream(self, path, view_xml=None):
266266
"""
267267
if view_xml is None:
268268
view_xml = "<View><Query></Query></View>"
269-
return_type = ClientResult(self.context, dict())
269+
return_type = ClientResult(self.context, {})
270270

271271
def _get_list_data_as_stream():
272272
list_abs_url = self.url + path

office365/teams/schedule/shifts/item.py

+1
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@ def __init__(self, display_name=None, activities=None):
1212
:param list[ShiftActivity] activities: An incremental part of a shift which can cover details of when and
1313
where an employee is during their shift. For example, an assignment or a scheduled break or lunch.
1414
"""
15+
super(ShiftItem, self).__init__()
1516
self.displayName = display_name
1617
self.activities = ClientValueCollection(ShiftActivity, activities)

0 commit comments

Comments
 (0)