style: Flake8によるリント不正の解消。フォーマット文字列は変数が埋め込まれていなくてもエラーにしないよう、チェックを無視するように修正した

This commit is contained in:
shimoda.m@nds-tyo.co.jp 2022-07-21 20:00:35 +09:00
parent 24149be0b1
commit e532b395df
5 changed files with 14 additions and 8 deletions

View File

@ -10,7 +10,7 @@
"python.linting.enabled": true, "python.linting.enabled": true,
"python.linting.pylintEnabled": false, "python.linting.pylintEnabled": false,
"python.linting.flake8Enabled": true, "python.linting.flake8Enabled": true,
"python.linting.flake8Args": ["--max-line-length=150"], "python.linting.flake8Args": ["--max-line-length=150", "--ignore=F541"],
"python.formatting.provider": "autopep8", "python.formatting.provider": "autopep8",
"python.formatting.autopep8Args": ["--max-line-length", "150"] "python.formatting.autopep8Args": ["--max-line-length", "150"]
} }

View File

@ -1,5 +1,3 @@
from datetime import datetime
from src.constants import CONV_JP_NAME from src.constants import CONV_JP_NAME
from src.converter.converter import CSVStringConverter from src.converter.converter import CSVStringConverter
from src.error.exceptions import DataConvertException from src.error.exceptions import DataConvertException

View File

@ -81,7 +81,10 @@ def fetch_crm_data(target_object, last_fetch_datetime):
return sf_object_jsons return sf_object_jsons
@retry(wait=wait_exponential(multiplier=CRM_GET_RECORD_COUNT_RETRY_INTERVAL, min=CRM_GET_RECORD_COUNT_RETRY_MIN_INTERVAL, max=CRM_GET_RECORD_COUNT_RETRY_MAX_INTERVAL), stop=stop_after_attempt(CRM_GET_RECORD_COUNT_MAX_RETRY_ATTEMPT)) @retry(
wait=wait_exponential(multiplier=CRM_GET_RECORD_COUNT_RETRY_INTERVAL,
min=CRM_GET_RECORD_COUNT_RETRY_MIN_INTERVAL, max=CRM_GET_RECORD_COUNT_RETRY_MAX_INTERVAL),
stop=stop_after_attempt(CRM_GET_RECORD_COUNT_MAX_RETRY_ATTEMPT))
def fetch_sf_count_retry(object_name, last_update_datetime_from, last_update_datetime_to): def fetch_sf_count_retry(object_name, last_update_datetime_from, last_update_datetime_to):
try: try:
global count_contime_counter, count_readtime_counter, count_counter global count_contime_counter, count_readtime_counter, count_counter
@ -110,7 +113,10 @@ def fetch_sf_count_retry(object_name, last_update_datetime_from, last_update_dat
raise e raise e
@retry(wait=wait_exponential(multiplier=CRM_FETCH_RECORD_RETRY_INTERVAL, min=CRM_FETCH_RECORD_RETRY_MIN_INTERVAL, max=CRM_FETCH_RECORD_RETRY_MAX_INTERVAL), stop=stop_after_attempt(CRM_FETCH_RECORD_MAX_RETRY_ATTEMPT)) @retry(
wait=wait_exponential(multiplier=CRM_FETCH_RECORD_RETRY_INTERVAL,
min=CRM_FETCH_RECORD_RETRY_MIN_INTERVAL, max=CRM_FETCH_RECORD_RETRY_MAX_INTERVAL),
stop=stop_after_attempt(CRM_FETCH_RECORD_MAX_RETRY_ATTEMPT))
def fetch_sf_data_retry(columns, object_name, last_update_datetime_from, last_update_datetime_to): def fetch_sf_data_retry(columns, object_name, last_update_datetime_from, last_update_datetime_to):
try: try:
global data_contime_counter, data_readtime_counter, data_counter global data_contime_counter, data_readtime_counter, data_counter

View File

@ -80,7 +80,7 @@ def main() -> None:
# 9. CSV変換処理を呼び出す # 9. CSV変換処理を呼び出す
logger.info( logger.info(
f'I-CTRL-12 [{target_object.object_name}] CSV変換処理呼び出し') f'I-CTRL-12 [{target_object.object_name}] CSV変換処理呼び出し')
csv_object = convert_crm_csvdata(target_object, sf_object_jsons) csv_object = convert_crm_csvdata(target_object, sf_object_jsons)
# 10. CSVバックアップ処理を呼び出す # 10. CSVバックアップ処理を呼び出す
logger.info( logger.info(

View File

@ -12,7 +12,7 @@ def updload_last_fetch_datetime(target_object, last_fetch_datetime):
f'I-UPD-01 [{target_object.object_name}] の前回取得日時ファイルの更新処理を開始します') f'I-UPD-01 [{target_object.object_name}] の前回取得日時ファイルの更新処理を開始します')
try: try:
if target_object.is_update_last_fetch_datetime == False: if target_object.is_update_last_fetch_datetime is False:
# ② オブジェクト情報.is_update_last_fetch_datetimeがfalseの場合、以降の処理をスキップする # ② オブジェクト情報.is_update_last_fetch_datetimeがfalseの場合、以降の処理をスキップする
logger.info( logger.info(
f'I-UPD-02 [{target_object.object_name}] の前回取得日時ファイルの更新処理をスキップします') f'I-UPD-02 [{target_object.object_name}] の前回取得日時ファイルの更新処理をスキップします')
@ -33,7 +33,9 @@ def updload_last_fetch_datetime(target_object, last_fetch_datetime):
except Exception as e: except Exception as e:
raise FileUploadException( raise FileUploadException(
'E-UPD-01', UPD_JP_NAME, f'[{target_object.object_name}] 前回処理日時ファイルのアップロードに失敗しました ファイル名:[{target_object.last_fetch_datetime_file_name}] エラー内容:[{e}]') 'E-UPD-01',
UPD_JP_NAME,
f'[{target_object.object_name}] 前回処理日時ファイルのアップロードに失敗しました ファイル名:[{target_object.last_fetch_datetime_file_name}] エラー内容:[{e}]')
# ④ 前回取得日時ファイル更新処理の終了ログを出力する # ④ 前回取得日時ファイル更新処理の終了ログを出力する
logger.info( logger.info(