yapf
yapf copied to clipboard
YAPF: disable not respected
Related to https://github.com/google/yapf/issues/146
for index, record in data.iterrows():
# yapf: disable
cursor.execute(
insert,
(
record["Employee Name"],
record["Job Title"],
float(record["Base Pay"]),
float(record["Overtime Pay"]),
float(record["Other Pay"]),
0.0 if record["Benefits"] == "Not Provided" else float(record["Benefits"]),
float(record["Total Pay"]),
float(record["Total Pay & Benefits"]),
int(record["Year"]),
"" if math.isnan(record["Notes"]) else record["Notes"],
record["Agency"],
"" if math.isnan(record["Status"]) else record["Status"]
)
)
# yapf: enable
Gets formatted to
for index, record in data.iterrows():
# yapf: disable
cursor.execute(
insert,
(
record["Employee Name"],
record["Job Title"],
float(record["Base Pay"]),
float(record["Overtime Pay"]),
float(record["Other Pay"]),
0.0 if record["Benefits"] == "Not Provided" else float(record["Benefits"]),
float(record["Total Pay"]),
float(record["Total Pay & Benefits"]),
int(record["Year"]),
"" if math.isnan(record["Notes"]) else record["Notes"],
record["Agency"],
"" if math.isnan(record["Status"]) else record["Status"]
)
)
# yapf: enable
Same issue here. This is a most basic feature not being addressed for almost a year now? Is this project still alive?
Sorry, I didn't see this. It looks like something to do with tabs not being added correctly.
Thanks for the quick reply! I do not have the capacity to address this personally right now, but if the issue is what you say it might be not too hard to fix. Thanks for looking into it!
when using # yapf: disable
inside visual studio code with yapf formatter activated, this settings is ignored for me too.
reproduced with version 0.920+dev.8e82171a3e68a5180fab267cad4d2b7cfa1f5cd