German-Immersive-Railroading-Community / BackupSystem

Use of an unneeded not detected PYL-C0113
Anti-pattern
Major
2 years ago2 years old
Consider changing "not 'last' in data.keys()" to "'last' not in data.keys()"
 66    lg.warning('There was something wrong with the data.json; fixing...')
 67if not 'sha' in data.keys():
 68    data['sha'] = {}
 69if not 'last' in data.keys(): 70    lg.warning('No last update date found; setting standard')
 71    data['last'] = '1999-12-01'
 72
Consider changing "not 'sha' in data.keys()" to "'sha' not in data.keys()"
 64    lg.warning('data.json not found; creating...')
 65except json.JSONDecodeError:
 66    lg.warning('There was something wrong with the data.json; fixing...')
 67if not 'sha' in data.keys(): 68    data['sha'] = {}
 69if not 'last' in data.keys():
 70    lg.warning('No last update date found; setting standard')