Skip to content

Commit

Permalink
Made linter a little happier
Browse files Browse the repository at this point in the history
From some source files
- removed unused imports
- replaced unused variables with _
- no need to explicitly inherit a class from object anymore
  • Loading branch information
pchakraborty committed May 21, 2024
1 parent 764c495 commit da3f012
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 26 deletions.
1 change: 0 additions & 1 deletion docs/make_md_docs.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/usr/bin/env python3

import os
import io
import glob
from mdutils.mdutils import MdUtils
import subprocess as sp
Expand Down
5 changes: 1 addition & 4 deletions src/mepo/cmdline/branch_parser.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import argparse


class MepoBranchArgParser(object):
class MepoBranchArgParser:

def __init__(self, branch):
self.branch_subparsers = branch.add_subparsers()
Expand Down
14 changes: 5 additions & 9 deletions src/mepo/cmdline/config_parser.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
import argparse
import textwrap


class MepoConfigArgParser(object):
class MepoConfigArgParser:

def __init__(self, config):
self.config = config.add_subparsers()
Expand All @@ -26,16 +22,16 @@ def __get(self):
get.add_argument("entry", metavar="entry", help="Entry to display.")

def __set(self):
set = self.config.add_parser(
set_ = self.config.add_parser(
"set",
description=(
"Set config `entry` to `value` in `.mepoconfig`. "
"Note this uses gitconfig style where `entry` is of the form `section.option`. "
"So to set an `alias` for `status` of `st` You would run `mepo config set alias.st status`"
),
)
set.add_argument("entry", metavar="entry", help="Entry to set.")
set.add_argument("value", metavar="value", help="Value to set entry to.")
set_.add_argument("entry", metavar="entry", help="Entry to set.")
set_.add_argument("value", metavar="value", help="Value to set entry to.")

def __delete(self):
delete = self.config.add_parser(
Expand All @@ -49,6 +45,6 @@ def __delete(self):
delete.add_argument("entry", metavar="entry", help="Entry to delete.")

def __print(self):
print = self.config.add_parser(
_ = self.config.add_parser(
"print", description="Print contents of `.mepoconfig`"
)
6 changes: 3 additions & 3 deletions src/mepo/cmdline/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from ..utilities import mepoconfig


class MepoArgParser(object):
class MepoArgParser:

__slots__ = ["parser", "subparsers"]

Expand Down Expand Up @@ -152,7 +152,7 @@ def __status(self):
)

def __restore_state(self):
restore_state = self.subparsers.add_parser(
_ = self.subparsers.add_parser(
"restore-state",
description="Restores all components to the last saved state.",
aliases=mepoconfig.get_command_alias("restore-state"),
Expand Down Expand Up @@ -490,7 +490,7 @@ def __config(self):
MepoConfigArgParser(config)

def __update_state(self):
update_state = self.subparsers.add_parser(
_ = self.subparsers.add_parser(
"update-state",
description="Permanently update mepo1 state to current",
aliases=mepoconfig.get_command_alias("update-state"),
Expand Down
7 changes: 2 additions & 5 deletions src/mepo/cmdline/stash_parser.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import argparse


class MepoStashArgParser(object):
class MepoStashArgParser:

def __init__(self, stash):
self.stash = stash.add_subparsers()
Expand Down Expand Up @@ -48,7 +45,7 @@ def __show(self):
)

def __list(self):
stlist = self.stash.add_parser(
_ = self.stash.add_parser(
"list", description="List local stashes of all components"
)

Expand Down
5 changes: 1 addition & 4 deletions src/mepo/cmdline/tag_parser.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import argparse


class MepoTagArgParser(object):
class MepoTagArgParser:

def __init__(self, tag):
self.tag = tag.add_subparsers()
Expand Down

0 comments on commit da3f012

Please sign in to comment.