Skip to content

Commit c8e81f3

Browse files
committed
Rename utils.txfDate() -> txf_date()
Address lint warning by using snake_case naming instead of camelCase.
1 parent e20b0cc commit c8e81f3

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

csv2txf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def ConvertTxnListToTxf(txn_list: list[utils.Transaction], tax_year: int, date:
3939
lines.append('V042') # Version
4040
lines.append('Acsv2txf') # Program name/version
4141
if date is None:
42-
date = utils.txfDate(datetime.today())
42+
date = utils.txf_date(datetime.today())
4343
lines.append('D%s' % date) # Export date
4444
lines.append('^')
4545
for txn in txn_list:

tdameritrade.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,10 @@ def parseFileToTxnList(cls, filename: str, tax_year: Optional[int]) -> list[util
124124
curr_txn.desc = '%s shares %s' % (
125125
cls.numShares(txn_dict), cls.symbol(txn_dict))
126126
buyDate = cls.buyDate(txn_dict)
127-
curr_txn.buyDateStr = utils.txfDate(buyDate)
127+
curr_txn.buyDateStr = utils.txf_date(buyDate)
128128
curr_txn.costBasis = cls.costBasis(txn_dict)
129129
sellDate = cls.sellDate(txn_dict)
130-
curr_txn.sellDateStr = utils.txfDate(sellDate)
130+
curr_txn.sellDateStr = utils.txf_date(sellDate)
131131
curr_txn.saleProceeds = cls.saleProceeds(txn_dict)
132132

133133
assert sellDate >= buyDate, f'Sell date ({sellDate}) must be on or after buy date ({buyDate})'

utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def __str__(self) -> str:
7878
return ','.join(formatted_data)
7979

8080

81-
def txfDate(date: datetime) -> str:
81+
def txf_date(date: datetime) -> str:
8282
"""Returns a date string in the TXF format, which is MM/DD/YYYY."""
8383
return date.strftime('%m/%d/%Y')
8484

vanguard.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def parseFileToTxnList(cls, filename: str, tax_year: Optional[int]) -> list[util
117117
curr_txn.desc = '%d shares %s' % (
118118
cls.numShares(buy), cls.symbol(buy))
119119
curr_txn.buyDate = cls.date(txn_dict)
120-
curr_txn.buyDateStr = utils.txfDate(curr_txn.buyDate)
120+
curr_txn.buyDateStr = utils.txf_date(curr_txn.buyDate)
121121
curr_txn.costBasis = cls.netAmount(txn_dict)
122122
elif cls.isSell(txn_dict):
123123
sell = txn_dict
@@ -134,7 +134,7 @@ def parseFileToTxnList(cls, filename: str, tax_year: Optional[int]) -> list[util
134134
continue
135135

136136
sellDate: datetime = cls.date(sell)
137-
curr_txn.sellDateStr = utils.txfDate(sellDate)
137+
curr_txn.sellDateStr = utils.txf_date(sellDate)
138138
curr_txn.saleProceeds = cls.netAmount(sell)
139139

140140
if utils.isLongTerm(buyDate, sellDate):

0 commit comments

Comments
 (0)