Skip to content

Commit

Permalink
Merge pull request #957 from HERA-Team/nonbasic-ruff
Browse files Browse the repository at this point in the history
Add Ruff Rule A* (names shadowing builtins)
  • Loading branch information
tyler-a-cox authored Jul 5, 2024
2 parents a0b3292 + 0ed2783 commit 0188ab7
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 4 deletions.
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
]

0 comments on commit 0188ab7

Please sign in to comment.