Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Ruff Rule A* (names shadowing builtins) #957

Merged
merged 7 commits into from
Jul 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def __getattr__(cls, name):

# General information about the project.
project = u'hera_cal'
copyright = u'2017, HERA Collaboration'
copyright = u'2017, HERA Collaboration' # noqa: A001
author = u'HERA Collaboration'

# The version info for the project you're documenting, acts as replacement for
Expand Down
2 changes: 1 addition & 1 deletion hera_cal/chunker.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from pyuvdata import utils as uvutils


def chunk_files(filenames, inputfile, outputfile, chunk_size, type="data",
def chunk_files(filenames, inputfile, outputfile, chunk_size, type="data", # noqa: A002
polarizations=None, spw_range=None, throw_away_flagged_ants=False,
clobber=False, ant_flag_yaml=None, **read_kwargs):
"""Chunk a list of data or cal files together into a single file.
Expand Down
2 changes: 1 addition & 1 deletion hera_cal/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ def interp_peak(data, method='quinn', reject_edges=False):
return indices, bin_shifts, peaks, new_peaks


def echo(message, type=0, verbose=True):
def echo(message, type=0, verbose=True): # noqa: A002
if verbose:
if type == 0:
print(message)
Expand Down
50 changes: 49 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,60 @@ target-version = "py39"
[tool.ruff.lint]
select = [
"E",
"W"
"W",
"A", # builtins
# "ARG", # unused arguments
# "B", # bugbear
# "C4", # comprehensions
# "C90", # mccabe complexity
# "COM", # commas
# "D", # docstyle
# "DTZ", # datetime
# "F", # pyflakes
# "FA", # future annotations
# "FURB", # refurb
# "I", # isort
# "ISC", # implicit string concat
# "LOG", # logging
# "N", # pep8-naming
# "NPY", # numpy-specific rules
# "PERF", # performance
# "UP", # pyupgrade
# "PIE", # flake8-pie
# "PLC", # pylint
# "PLE", # pylint
# "PLR", # pylint
# "PLW", # pylint
# "PT", # pytest-style
# "PTH", # use pathlib
# "Q", # quotes
# "RSE", # flake8-raise
# "RUF", # ruff-specific rules
# "SIM", # flake8-simplify
# "TRY", # tryceratops
# "UP", # pyupgrade
]

ignore = [
"E402",
"E501",
"W291",
"W293",
# Following Rulesets we really don't want
"AIR", # airflow - unused library
"ASYNC", # async -- unused library
"DJ", # django -- unused library
"EXE", # executable -- unused features
"G", # logging-format -- this linter gives bad advice a lot
"INT", # gettext -- unknown why we would use this
"PD", # unused library
"PGH", # pygrep hooks?
"PYI", # typing stuff
"S", # flake8-bandit -- security stuff that isn't really applicable
"SLOT", # slots stuff that isn't applicable atm
"TCH", # type-checking
"TD", # todo's
"TID", # tidy imports (should be done with isort)
"TRIO", # trio unused package
"YTT", # py2to3 stuff
]
Loading