mirror of
https://github.com/GAM-team/GAM.git
synced 2025-05-12 04:07:21 +00:00
Pre-commit (#1467)
* pre-commit run trailing-whitespace -a * pre-commit run end-of-file-fixer -a * pre-commit run double-quote-string-fixer -a * pre-commit run requirements-txt-fixer -a * add pyupgrade hook * remove pre-commit default_language_version 3.7 (since no upwards incompatible hooks)
This commit is contained in:
parent
7320136079
commit
7710711def
1
.github/actions/macos-before-install.sh
vendored
1
.github/actions/macos-before-install.sh
vendored
@ -129,4 +129,3 @@ $pip install pyscard
|
|||||||
$python -V
|
$python -V
|
||||||
|
|
||||||
cd $whereibelong
|
cd $whereibelong
|
||||||
|
|
||||||
|
@ -1,7 +1,4 @@
|
|||||||
# See https://pre-commit.com for more information
|
# See https://pre-commit.com for more information
|
||||||
# See https://pre-commit.com/hooks.html for more hooks
|
|
||||||
default_language_version:
|
|
||||||
python: python3.7
|
|
||||||
|
|
||||||
repos:
|
repos:
|
||||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||||
@ -27,3 +24,9 @@ repos:
|
|||||||
hooks:
|
hooks:
|
||||||
- id: pylint
|
- id: pylint
|
||||||
args: [--output-format=colorized]
|
args: [--output-format=colorized]
|
||||||
|
|
||||||
|
- repo: https://github.com/asottile/pyupgrade
|
||||||
|
rev: v2.31.0
|
||||||
|
hooks:
|
||||||
|
- id: pyupgrade
|
||||||
|
args: [--py37-plus]
|
||||||
|
@ -3734,7 +3734,7 @@ def getDriveFileAttribute(i, body, parameters, myarg, update=False):
|
|||||||
i += 2
|
i += 2
|
||||||
else:
|
else:
|
||||||
controlflow.invalid_argument_exit(
|
controlflow.invalid_argument_exit(
|
||||||
myarg, f"gam <users> {operation} drivefile")
|
myarg, f'gam <users> {operation} drivefile')
|
||||||
return i
|
return i
|
||||||
|
|
||||||
|
|
||||||
|
@ -211,7 +211,7 @@ def update():
|
|||||||
browser.update(body)
|
browser.update(body)
|
||||||
result = gapi.call(cbcm.chromebrowsers(), 'update', deviceId=device_id,
|
result = gapi.call(cbcm.chromebrowsers(), 'update', deviceId=device_id,
|
||||||
customer=customer_id, body=browser,
|
customer=customer_id, body=browser,
|
||||||
projection='BASIC', fields="deviceId")
|
projection='BASIC', fields='deviceId')
|
||||||
print(f'Updated browser {result["deviceId"]}')
|
print(f'Updated browser {result["deviceId"]}')
|
||||||
|
|
||||||
|
|
||||||
|
@ -76,7 +76,7 @@ def print_members():
|
|||||||
todrive = True
|
todrive = True
|
||||||
i += 1
|
i += 1
|
||||||
else:
|
else:
|
||||||
controlflow.invalid_argument_exit(myarg, "gam print chatmembers")
|
controlflow.invalid_argument_exit(myarg, 'gam print chatmembers')
|
||||||
if not space:
|
if not space:
|
||||||
controlflow.system_error_exit(2,
|
controlflow.system_error_exit(2,
|
||||||
'space <ChatSpace> is required.')
|
'space <ChatSpace> is required.')
|
||||||
@ -117,7 +117,7 @@ def create_message():
|
|||||||
body['thread'] = {'name': sys.argv[i+1]}
|
body['thread'] = {'name': sys.argv[i+1]}
|
||||||
i += 2
|
i += 2
|
||||||
else:
|
else:
|
||||||
controlflow.invalid_argument_exit(myarg, "gam create chat")
|
controlflow.invalid_argument_exit(myarg, 'gam create chat')
|
||||||
if not space:
|
if not space:
|
||||||
controlflow.system_error_exit(2,
|
controlflow.system_error_exit(2,
|
||||||
'space <ChatSpace> is required.')
|
'space <ChatSpace> is required.')
|
||||||
@ -151,7 +151,7 @@ def delete_message():
|
|||||||
name = sys.argv[i+1]
|
name = sys.argv[i+1]
|
||||||
i += 2
|
i += 2
|
||||||
else:
|
else:
|
||||||
controlflow.invalid_argument_exit(myarg, "gam delete chat")
|
controlflow.invalid_argument_exit(myarg, 'gam delete chat')
|
||||||
if not name:
|
if not name:
|
||||||
controlflow.system_error_exit(2,
|
controlflow.system_error_exit(2,
|
||||||
'name <String> is required.')
|
'name <String> is required.')
|
||||||
@ -182,7 +182,7 @@ def update_message():
|
|||||||
name = sys.argv[i+1]
|
name = sys.argv[i+1]
|
||||||
i += 2
|
i += 2
|
||||||
else:
|
else:
|
||||||
controlflow.invalid_argument_exit(myarg, "gam update chat")
|
controlflow.invalid_argument_exit(myarg, 'gam update chat')
|
||||||
if not name:
|
if not name:
|
||||||
controlflow.system_error_exit(2,
|
controlflow.system_error_exit(2,
|
||||||
'name <String> is required.')
|
'name <String> is required.')
|
||||||
|
@ -203,7 +203,7 @@ def printHistory():
|
|||||||
if 'channel' in citem:
|
if 'channel' in citem:
|
||||||
citem['channel'] = citem['channel'].lower()
|
citem['channel'] = citem['channel'].lower()
|
||||||
else:
|
else:
|
||||||
channel_match = re.search(r"\/channels\/([^/]*)", citem['name'])
|
channel_match = re.search(r'\/channels\/([^/]*)', citem['name'])
|
||||||
if channel_match:
|
if channel_match:
|
||||||
try:
|
try:
|
||||||
citem['channel'] = channel_match.group(1)
|
citem['channel'] = channel_match.group(1)
|
||||||
@ -212,7 +212,7 @@ def printHistory():
|
|||||||
if 'platform' in citem:
|
if 'platform' in citem:
|
||||||
citem['platform'] = citem['platform'].lower()
|
citem['platform'] = citem['platform'].lower()
|
||||||
else:
|
else:
|
||||||
platform_match = re.search(r"\/platforms\/([^/]*)", citem['name'])
|
platform_match = re.search(r'\/platforms\/([^/]*)', citem['name'])
|
||||||
if platform_match:
|
if platform_match:
|
||||||
try:
|
try:
|
||||||
citem['platform'] = platform_match.group(1)
|
citem['platform'] = platform_match.group(1)
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
yubikey-manager>=4.0.0
|
|
||||||
cryptography
|
cryptography
|
||||||
distro; sys_platform == 'linux'
|
distro; sys_platform == 'linux'
|
||||||
filelock
|
filelock
|
||||||
@ -9,5 +8,6 @@ google-auth>=2.3.2
|
|||||||
httplib2>=0.17.0
|
httplib2>=0.17.0
|
||||||
importlib.metadata; python_version < '3.8'
|
importlib.metadata; python_version < '3.8'
|
||||||
passlib>=1.7.2
|
passlib>=1.7.2
|
||||||
python-dateutil
|
|
||||||
pathvalidate
|
pathvalidate
|
||||||
|
python-dateutil
|
||||||
|
yubikey-manager>=4.0.0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user