Skip to content

Commit

Permalink
ruff: enable ICN and PD rules
Browse files Browse the repository at this point in the history
  • Loading branch information
karlicoss committed Aug 28, 2024
1 parent bf96ca7 commit caa72aa
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion my/body/weight.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def it():
}

df = pd.DataFrame(it())
df.set_index('dt', inplace=True)
df = df.set_index('dt')
# TODO not sure about UTC??
df.index = pd.to_datetime(df.index, utc=True)
return df
Expand Down
4 changes: 2 additions & 2 deletions my/emfit/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,9 @@ def dataframe() -> DataFrameT:
last = s # meh
dicts.append(d)

import pandas
import pandas as pd

return pandas.DataFrame(dicts)
return pd.DataFrame(dicts)


def stats() -> Stats:
Expand Down
4 changes: 4 additions & 0 deletions ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ lint.extend-select = [
"C4", # flake8-comprehensions -- unnecessary list/map/dict calls
"COM", # trailing commas
"EXE", # various checks wrt executable files
"ICN", # various import conventions
"FBT", # detect use of boolean arguments
"FURB", # various rules
"PERF", # various potential performance speedups
"PD", # pandas rules
"PIE", # 'misc' lints
"PLR", # 'refactor' rules
"PLW", # pylint warnings
Expand Down Expand Up @@ -104,4 +106,6 @@ lint.ignore = [
"PT012", # pytest raises should contain a single statement

"COM812", # trailing comma missing -- TODO maybe use this?

"PD901", # generic variable name df
]

0 comments on commit caa72aa

Please sign in to comment.