Skip to content
Snippets Groups Projects

Fix all Ruff docstring issues

Merged Duncan Macleod requested to merge duncanmmacleod/gwdatafind:ruff-docstrings into main
5 files
+ 22
32
Compare changes
  • Side-by-side
  • Inline
Files
5
+ 7
11
@@ -15,8 +15,7 @@
# You should have received a copy of the GNU General Public License
# along with GWDataFind. If not, see <http://www.gnu.org/licenses/>.
"""Query a GWDataFind server for information.
"""
"""Query a GWDataFind server for information."""
import argparse
import re
@@ -44,7 +43,7 @@ class DataFindFormatter(
argparse.ArgumentDefaultsHelpFormatter,
argparse.RawDescriptionHelpFormatter,
):
pass
"""Custom `argparse.Formatter` for GWDataFind."""
class DataFindArgumentParser(argparse.ArgumentParser):
@@ -52,16 +51,15 @@ class DataFindArgumentParser(argparse.ArgumentParser):
Mainly to handle the legacy mutually-exclusive optional arguments...
"""
def __init__(self, *args, **kwargs):
"""Create a new `DataFindArgumentParser`.
"""
"""Create a new `DataFindArgumentParser`."""
kwargs.setdefault("formatter_class", DataFindFormatter)
super().__init__(*args, **kwargs)
self._optionals.title = "Optional arguments"
def parse_args(self, *args, **kwargs):
"""Parse arguments with an extra sanity check.
"""
"""Parse arguments with an extra sanity check."""
args = super().parse_args(*args, **kwargs)
args.show_urls = not any((args.ping, args.show_observatories,
args.show_types, args.show_times,
@@ -100,8 +98,7 @@ class DataFindArgumentParser(argparse.ArgumentParser):
def command_line():
"""Build an `~argparse.ArgumentParser` for the `gwdatafind` CLI.
"""
"""Build an `~argparse.ArgumentParser` for the `gwdatafind` CLI."""
try:
defhost = get_default_host()
except ValueError:
@@ -524,8 +521,7 @@ def postprocess_cache(urls, args, out):
# -- CLI ----------------------------------------------------------------------
def main(args=None):
"""Run the thing.
"""
"""Run the thing."""
# parse command line
parser = command_line()
opts = parser.parse_args(args=args)
Loading