Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pylint guidelines #6822

Merged
merged 22 commits into from
Aug 21, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
more rules/tests
  • Loading branch information
kristapratico committed Jul 25, 2019
commit a619d4075d8e291da2a6b1cb808e6701dc7753a2
74 changes: 49 additions & 25 deletions plugins/example.py
Original file line number Diff line number Diff line change
@@ -1,48 +1,71 @@
# ------------------------------------
# Copyright (c) Microsoft Corporation.
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
# ------------------------------------

""" This is an example to use for quick pylint tests
"""

from azure.core import HttpResponseError
from azure.core.tracing.decorator import distributed_trace

class MyExampleClient(object):
""" A simple, canonical client

.. code-block:: python
thing = 5
"""

def __init__(self, base_url, credential, **kwargs):
""" This constructor follows the canonical pattern.
"""
self._client = None

@staticmethod
def create_configuration(param): # pylint: disable=client-method-missing-kwargs
@distributed_trace
@classmethod
def create_configuration(
self, param: str, **kwargs
) -> None: # pylint: disable=client-method-missing-kwargs
""" All methods should allow for a configuration instance to be created.
"""

async def get_thing(self, name):
# type: (str) -> Thing
""" Getting a single instance should include a required parameter
param str param: stuff
param int **thing: an int

- The first positional parameter should be a name or some other identifying
attribute of the `thing`.
.. code-block:: python
thing = 5
"""
# return self._client.blob.delete(one, two, self.three, four=4)

def list_things(self): # pylint: disable=client-method-missing-tracing-decorator
""" Getting a list of instances should not include any required parameters.
"""

def check_if_exists(self):
"""Checking if something exists
"""
@distributed_trace
def get_thing(self, one, two, three, four):
""" Getting a single instance should include a required parameter

def _ignore_me(self):
"""Ignore this internal method
- The first positional parameter should be a name or some other identifying
attribute of the `thing`.
"""

def put_thing(self):
"""Not an approved name prefix.
@distributed_trace_async
async def __get_key(self, name: str, version: str = None):
"""hel
.. code-block:: python
thing = 5
"""
#
# class StorageErrorException(object):
# pass
# def list_things(self): # pylint: disable=client-method-missing-tracing-decorator
# """ Getting a list of instances should not include any required parameters.
# """
#
# def check_if_exists(self):
# """Checking if something exists
# """
#
# def _ignore_me(self):
# """Ignore this internal method
# """
#
# def put_thing(self):
# """Not an approved name prefix.
# """


# class MyExamplefClient(object):
Expand Down Expand Up @@ -78,6 +101,7 @@ def put_thing(self):
# """Ignore this internal method
# """
#
# def put_thing(self):
# """Not an approved name prefix.
# """
# def put_thing():
# """Not an approved name prefix.
# """
# client(one, two, three, four)
Loading