mirror of
https://github.com/super-linter/super-linter.git
synced 2024-11-25 18:20:57 -05:00
Fix python test for flake8
This commit is contained in:
parent
f372e4668b
commit
6c2e32ce14
1 changed files with 12 additions and 7 deletions
|
@ -23,6 +23,7 @@ headers = {
|
|||
'Content-Type': 'application/json'
|
||||
}
|
||||
|
||||
|
||||
def create_label(repo_id, label):
|
||||
"""
|
||||
Create label in the supplied repo.
|
||||
|
@ -52,6 +53,7 @@ def create_label(repo_id, label):
|
|||
|
||||
return response
|
||||
|
||||
|
||||
def get_labels(owner, repo):
|
||||
"""
|
||||
Gets a list of labels from the supplied repo.
|
||||
|
@ -62,7 +64,7 @@ def get_labels(owner, repo):
|
|||
:return: A tuple with the GitHub id for the repository and a list of labels defined in the repository
|
||||
"""
|
||||
|
||||
query_variables = { "owner": owner, "name": repo, }
|
||||
query_variables = {"owner": owner, "name": repo, }
|
||||
|
||||
with open(path.join(path.dirname(__file__), 'queries/get_repo_data.gql'), 'r') as query_file:
|
||||
query = "".join(query_file.readlines())
|
||||
|
@ -83,6 +85,7 @@ def get_labels(owner, repo):
|
|||
'[ERROR] getting issue labels. Status Code: {status_code} - Message: {result}'.format(
|
||||
status_code=status_code, result=result["message"]))
|
||||
|
||||
|
||||
def delete_label(label_id):
|
||||
"""
|
||||
Delete the specified label
|
||||
|
@ -106,6 +109,7 @@ def delete_label(label_id):
|
|||
|
||||
return result
|
||||
|
||||
|
||||
@click.command()
|
||||
@click.option('--dry', is_flag=True)
|
||||
@click.argument('source_repo')
|
||||
|
@ -149,6 +153,7 @@ def copy_labels(source_repo, target_repo, dry):
|
|||
|
||||
print('Done')
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
# Pylint doesn't know that @click.command takes care of injecting the
|
||||
# function parameters. Disabling Pylint error.
|
||||
|
|
Loading…
Reference in a new issue