Repository: repobee/repobee

Issue:
Start all log messages with capitalized letter
As the log messages are self-contained statements about the program execution, and are meant to be inspected and understandable by end users, they should be sentences (and thus be capitalized).

Discussion:

Patch:
diff --git a/repobee/cli.py b/repobee/cli.py
index dd022b3..f474dee 100644
--- a/repobee/cli.py
+++ b/repobee/cli.py
@@ -233,7 +233,7 @@ def _handle_deprecation(sys_args: List[str]) -> List[str]:
     if parser_name in DEPRECATED_PARSERS:
         deprecation = DEPRECATED_PARSERS[parser_name]
         LOGGER.warning(
-            "use of '{}' has been deprecated and will be removed by {}, "
+            "Use of '{}' has been deprecated and will be removed by {}, "
             "use '{}' instead".format(
                 parser_name, deprecation.remove_by, deprecation.replacement
             )
diff --git a/repobee/command.py b/repobee/command.py
index 281b21b..7e627a5 100644
--- a/repobee/command.py
+++ b/repobee/command.py
@@ -65,14 +65,14 @@ def setup_student_repos(
     urls = list(master_repo_urls)  # safe copy
 
     with tempfile.TemporaryDirectory() as tmpdir:
-        LOGGER.info("cloning into master repos ...")
+        LOGGER.info("Cloning into master repos ...")
         master_repo_paths = _clone_all(urls, cwd=tmpdir)
 
         teams = _add_students_to_teams(teams, api)
         repo_urls = _create_student_repos(urls, teams, api)
 
         push_tuples = _create_push_tuples(master_repo_paths, repo_urls)
-        LOGGER.info("pushing files to student repos ...")
+        LOGGER.info("Pushing files to student repos ...")
         git.push(push_tuples)
 
 
@@ -111,7 +111,7 @@ def _create_student_repos(
     Returns:
         a list of urls to the repos
     """
-    LOGGER.info("creating student repos ...")
+    LOGGER.info("Creating student repos ...")
     repo_infos = _create_repo_infos(master_repo_urls, teams)
     repo_urls = api.create_repos(repo_infos)
     return repo_urls
@@ -132,10 +132,10 @@ def _clone_all(urls: Iterable[str], cwd: str):
         raise ValueError("master_repo_urls contains duplicates")
     try:
         for url in urls:
-            LOGGER.info("cloning into {}".format(url))
+            LOGGER.info("Cloning into {}".format(url))
             git.clone_single(url, cwd=cwd)
     except exception.CloneFailedError:
-        LOGGER.error("error cloning into {}, aborting ...".format(url))
+        LOGGER.error("Error cloning into {}, aborting ...".format(url))
         raise
     paths = [os.path.join(cwd, util.repo_name(url)) for url in urls]
     assert all(map(util.is_git_repo, paths)), "all repos must be git repos"
@@ -168,19 +168,19 @@ def update_student_repos(
     repo_urls = api.get_repo_urls(master_repo_names, teams=teams)
 
     with tempfile.TemporaryDirectory() as tmpdir:
-        LOGGER.info("cloning into master repos ...")
+        LOGGER.info("Cloning into master repos ...")
         master_repo_paths = _clone_all(urls, tmpdir)
 
         push_tuples = _create_push_tuples(master_repo_paths, repo_urls)
 
-        LOGGER.info("pushing files to student repos ...")
+        LOGGER.info("Pushing files to student repos ...")
         failed_urls = git.push(push_tuples)
 
     if failed_urls and issue:
         LOGGER.info("Opening issue in repos to which push failed")
         _open_issue_by_urls(failed_urls, issue, api)
 
-    LOGGER.info("done!")
+    LOGGER.info("Done!")
 
 
 def _open_issue_by_urls(
@@ -360,7 +360,7 @@ def clone_repos(
     """
     repo_urls = api.get_repo_urls(master_repo_names, teams=teams)
 
-    LOGGER.info("cloning into student repos ...")
+    LOGGER.info("Cloning into student repos ...")
     git.clone(repo_urls)
 
     for plugin in plug.manager.get_plugins():
@@ -371,19 +371,19 @@ def clone_repos(
 
 
 def _execute_post_clone_hooks(repo_names: List[str], api: apimeta.API):
-    LOGGER.info("executing post clone hooks on repos")
+    LOGGER.info("Executing post clone hooks on repos")
     local_repos = [name for name in os.listdir() if name in repo_names]
 
     results = {}
     for repo_name in local_repos:
-        LOGGER.info("executing post clone hooks on {}".format(repo_name))
+        LOGGER.info("Executing post clone hooks on {}".format(repo_name))
         res = plug.manager.hook.act_on_cloned_repo(
             path=os.path.abspath(repo_name), api=api
         )
         results[repo_name] = res
     LOGGER.info(formatters.format_hook_results_output(results))
 
-    LOGGER.info("post clone hooks done")
+    LOGGER.info("Post clone hooks done")
 
 
 def migrate_repos(master_repo_urls: Iterable[str], api: apimeta.API) -> None:
@@ -423,7 +423,7 @@ def migrate_repos(master_repo_urls: Iterable[str], api: apimeta.API) -> None:
             ]
         )
 
-    LOGGER.info("done!")
+    LOGGER.info("Done!")
 
 
 def assign_peer_reviews(
@@ -598,7 +598,7 @@ def show_config() -> None:
     config.check_config_integrity()
 
     LOGGER.info(
-        "found valid config file at " + str(config.DEFAULT_CONFIG_FILE)
+        "Found valid config file at " + str(config.DEFAULT_CONFIG_FILE)
     )
     with config.DEFAULT_CONFIG_FILE.open(
         encoding=sys.getdefaultencoding()
diff --git a/repobee/config.py b/repobee/config.py
index 9231db3..a83627b 100644
--- a/repobee/config.py
+++ b/repobee/config.py
@@ -11,7 +11,6 @@ Contains the code required for pre-configuring user interfaces.
 import pathlib
 import configparser
 from typing import Union, List, Mapping
-import daiquiri
 import appdirs
 import repobee
 
@@ -19,8 +18,6 @@ from repobee import exception
 
 import repobee_plug as plug
 
-LOGGER = daiquiri.getLogger(__file__)
-
 CONFIG_DIR = pathlib.Path(
     appdirs.user_config_dir(appname=__package__, appauthor=repobee.__author__)
 )
diff --git a/repobee/ext/defaults.py b/repobee/ext/defaults.py
index c82faba..b651104 100644
--- a/repobee/ext/defaults.py
+++ b/repobee/ext/defaults.py
@@ -18,16 +18,11 @@ default implementation.
 import random
 from typing import Callable, Iterable, Mapping, List
 
-import daiquiri
-
 from repobee_plug import repobee_hook
 
-
 # import other default plugins
 from repobee.ext.github import DefaultAPIHooks  # noqa: F401
 
-LOGGER = daiquiri.getLogger(name=__file__)
-
 
 @repobee_hook
 def generate_review_allocations(
diff --git a/repobee/ext/github.py b/repobee/ext/github.py
index f9c92c4..2a58236 100644
--- a/repobee/ext/github.py
+++ b/repobee/ext/github.py
@@ -187,13 +187,13 @@ class GitHubAPI(apimeta.API):
         for team in self._get_teams_in(team_names):
             team.delete()
             deleted.add(team.name)
-            LOGGER.info("deleted team {}".format(team.name))
+            LOGGER.info("Deleted team {}".format(team.name))
 
         # only logging
         missing = set(team_names) - deleted
         if missing:
             LOGGER.warning(
-                "could not find teams: {}".format(", ".join(missing))
+                "Could not find teams: {}".format(", ".join(missing))
             )
 
     def _get_users(self, usernames: Iterable[str]) -> List[_User]:
@@ -215,7 +215,7 @@ class GitHubAPI(apimeta.API):
                         "Got unexpected response code from the GitHub API",
                         status=exc.status,
                     )
-                LOGGER.warning("user {} does not exist".format(name))
+                LOGGER.warning("User {} does not exist".format(name))
         return existing_users
 
     def ensure_teams_and_members(
@@ -271,7 +271,7 @@ class GitHubAPI(apimeta.API):
                 new_team = self._org.create_team(
                     team_name, permission=permission
                 )
-                LOGGER.info("created team {}".format(team_name))
+                LOGGER.info("Created team {}".format(team_name))
                 teams.append(new_team)
         return teams
 
@@ -292,7 +292,7 @@ class GitHubAPI(apimeta.API):
 
         if missing_members:
             LOGGER.info(
-                "adding members {} to team {}".format(
+                "Adding members {} to team {}".format(
                     ", ".join(missing_members), team.name
                 )
             )
@@ -330,7 +330,7 @@ class GitHubAPI(apimeta.API):
                 repo_urls.append(
                     self._org.create_repo(info.name, **kwargs).html_url
                 )
-                LOGGER.info("created {}/{}".format(self._org_name, info.name))
+                LOGGER.info("Created {}/{}".format(self._org_name, info.name))
                 created = True
 
             if not created:
@@ -451,7 +451,7 @@ class GitHubAPI(apimeta.API):
         for issue, repo in issue_repo_gen:
             issue.edit(state="closed")
             LOGGER.info(
-                "closed issue {}/#{}-'{}'".format(
+                "Closed issue {}/#{}-'{}'".format(
                     repo.name, issue.number, issue.title
                 )
             )
@@ -476,7 +476,7 @@ class GitHubAPI(apimeta.API):
                 issue.title, body=issue.body, assignees=reviewers
             )
             LOGGER.info(
-                "opened issue {}/#{}-'{}'".format(
+                "Opened issue {}/#{}-'{}'".format(
                     repo.name, created_issue.number, created_issue.title
                 )
             )
@@ -492,12 +492,12 @@ class GitHubAPI(apimeta.API):
         review_teams = self._get_teams_in(review_team_names)
         for review_team in review_teams:
             with _try_api_request():
-                LOGGER.info("processing {}".format(review_team.name))
+                LOGGER.info("Processing {}".format(review_team.name))
                 reviewers = set(m.login for m in review_team.get_members())
                 repos = list(review_team.get_repos())
                 if len(repos) != 1:
                     LOGGER.warning(
-                        "expected {} to have 1 associated repo, found {}."
+                        "Expected {} to have 1 associated repo, found {}."
                         "Skipping...".format(review_team.name, len(repos))
                     )
                     continue
@@ -544,7 +544,7 @@ class GitHubAPI(apimeta.API):
             repos = self._get_repos_by_name(team_to_repos[team.name])
             for repo in repos:
                 LOGGER.info(
-                    "adding team {} to repo {} with '{}' permission".format(
+                    "Adding team {} to repo {} with '{}' permission".format(
                         team.name, repo.name, team.permission
                     )
                 )
@@ -574,7 +574,7 @@ class GitHubAPI(apimeta.API):
         missing_repos = set(repo_names) - repos
         if missing_repos:
             LOGGER.warning(
-                "can't find repos: {}".format(", ".join(missing_repos))
+                "Can't find repos: {}".format(", ".join(missing_repos))
             )
 
     @staticmethod
@@ -586,7 +586,7 @@ class GitHubAPI(apimeta.API):
         master_org_name: Optional[str] = None,
     ) -> None:
         """See :py:func:`repobee.apimeta.APISpec.verify_settings`."""
-        LOGGER.info("verifying settings ...")
+        LOGGER.info("Verifying settings ...")
         if not token:
             raise exception.BadCredentials(
                 msg="token is empty. Check that REPOBEE_OAUTH environment "
@@ -595,7 +595,7 @@ class GitHubAPI(apimeta.API):
 
         g = github.Github(login_or_token=token, base_url=base_url)
 
-        LOGGER.info("trying to fetch user information ...")
+        LOGGER.info("Trying to fetch user information ...")
 
         user_not_found_msg = (
             "user {} could not be found. Possible reasons: "
@@ -604,7 +604,7 @@ class GitHubAPI(apimeta.API):
         with _convert_404_to_not_found_error(user_not_found_msg):
             user_ = g.get_user(user)
             msg = (
-                "specified login is {}, "
+                "Specified login is {}, "
                 "but the fetched user's login is {}.".format(user, user_.login)
             )
             if user_.login is None:
@@ -624,7 +624,7 @@ class GitHubAPI(apimeta.API):
             "user exists and base url looks okay".format(user)
         )
 
-        LOGGER.info("verifying oauth scopes ...")
+        LOGGER.info("Verifying oauth scopes ...")
         scopes = g.oauth_scopes
         if not REQUIRED_OAUTH_SCOPES.issubset(scopes):
             raise exception.BadCredentials(
@@ -637,12 +637,12 @@ class GitHubAPI(apimeta.API):
         if master_org_name:
             GitHubAPI._verify_org(master_org_name, user, g)
 
-        LOGGER.info("GREAT SUCCESS: All settings check out!")
+        LOGGER.info("GREAT SUCCESS: all settings check out!")
 
     @staticmethod
     def _verify_org(org_name: str, user: str, g: github.MainClass.Github):
         """Check that the organization exists and that the user is an owner."""
-        LOGGER.info("trying to fetch organization {} ...".format(org_name))
+        LOGGER.info("Trying to fetch organization {} ...".format(org_name))
         org_not_found_msg = (
             "organization {} could not be found. Possible "
             "reasons: org does not exist, user does not have "
@@ -653,7 +653,7 @@ class GitHubAPI(apimeta.API):
         LOGGER.info("SUCCESS: found organization {}".format(org_name))
 
         LOGGER.info(
-            "verifying that user {} is an owner of organization {}".format(
+            "Verifying that user {} is an owner of organization {}".format(
                 user, org_name
             )
         )
diff --git a/repobee/ext/gitlab.py b/repobee/ext/gitlab.py
index e76ecbb..d08a9b4 100644
--- a/repobee/ext/gitlab.py
+++ b/repobee/ext/gitlab.py
@@ -167,7 +167,7 @@ class GitLabAPI(apimeta.API):
 
         if missing_members:
             LOGGER.info(
-                "adding members {} to team {}".format(
+                "Adding members {} to team {}".format(
                     ", ".join(missing_members), team.name
                 )
             )
@@ -256,7 +256,7 @@ class GitLabAPI(apimeta.API):
                         "parent_id": parent_id,
                     }
                 )
-                LOGGER.info("created team {}".format(team_name))
+                LOGGER.info("Created team {}".format(team_name))
                 teams.append(new_team)
         return teams
 
@@ -282,7 +282,7 @@ class GitLabAPI(apimeta.API):
                     ).attributes["http_url_to_repo"]
                 )
                 LOGGER.info(
-                    "created {}/{}".format(self._group.name, repo.name)
+                    "Created {}/{}".format(self._group.name, repo.name)
                 )
                 created = True
 
@@ -363,7 +363,7 @@ class GitLabAPI(apimeta.API):
 
         missing = set(repo_names) - set(projects)
         if missing:
-            LOGGER.warning("can't find repos: {}".format(", ".join(missing)))
+            LOGGER.warning("Can't find repos: {}".format(", ".join(missing)))
 
     def open_issue(
         self, title: str, body: str, repo_names: Iterable[str]
@@ -392,16 +392,16 @@ class GitLabAPI(apimeta.API):
             issue.state_event = "close"
             issue.save()
             LOGGER.info(
-                "closed issue {}/#{}-'{}'".format(
+                "Closed issue {}/#{}-'{}'".format(
                     project_name, issue.id, issue.title
                 )
             )
             closed += 1
 
         if closed:
-            LOGGER.info("closed {} issues".format(closed))
+            LOGGER.info("Closed {} issues".format(closed))
         else:
-            LOGGER.warning("found no issues matching the title regex")
+            LOGGER.warning("Found no issues matching the title regex")
 
     def get_issues(
         self,
diff --git a/repobee/ext/javac.py b/repobee/ext/javac.py
index bccaeda..4887237 100644
--- a/repobee/ext/javac.py
+++ b/repobee/ext/javac.py
@@ -25,14 +25,10 @@ import configparser
 import pathlib
 from typing import Union, Iterable, Tuple
 
-import daiquiri
-
 from repobee import util
 
 from repobee_plug import Plugin, HookResult, Status
 
-LOGGER = daiquiri.getLogger(name=__file__)
-
 SECTION = "javac"
 
 
diff --git a/repobee/ext/pylint.py b/repobee/ext/pylint.py
index b6f5d33..41c6ea8 100644
--- a/repobee/ext/pylint.py
+++ b/repobee/ext/pylint.py
@@ -60,7 +60,7 @@ def _pylint(python_files: Iterable[Union[pathlib.Path]]) -> Tuple[str, str]:
     """
     linted_files = []
     for py_file in python_files:
-        LOGGER.info("running pylint on {!s}".format(py_file))
+        LOGGER.info("Running pylint on {!s}".format(py_file))
         command = "pylint {!s}".format(py_file).split()
         proc = subprocess.run(
             command, stdout=subprocess.PIPE, stderr=subprocess.PIPE
diff --git a/repobee/formatters.py b/repobee/formatters.py
index d66072c..e3877cd 100644
--- a/repobee/formatters.py
+++ b/repobee/formatters.py
@@ -66,7 +66,7 @@ def _format_reviewer(
     elif len(review_list) != num_reviews:
         LOGGER.warning(
             (
-                "expected {} to be assigned to {} review teams, but found {}. "
+                "Expected {} to be assigned to {} review teams, but found {}. "
                 "Review teams may have been tampered with."
             ).format(reviewer, num_reviews, len(review_list))
         )
diff --git a/repobee/git.py b/repobee/git.py
index 50c3131..1eed3f4 100644
--- a/repobee/git.py
+++ b/repobee/git.py
@@ -197,7 +197,7 @@ def push(push_tuples: Iterable[Push], tries: int = 3) -> List[str]:
     # confusing, but failed_pts needs an initial value
     failed_pts = list(push_tuples)
     for i in range(tries):
-        LOGGER.info("pushing, attempt {}/{}".format(i + 1, tries))
+        LOGGER.info("Pushing, attempt {}/{}".format(i + 1, tries))
         failed_urls = set(_push_no_retry(failed_pts))
         failed_pts = [pt for pt in push_tuples if pt.repo_url in failed_urls]
         if not failed_pts:
diff --git a/repobee/main.py b/repobee/main.py
index 67fe900..90e78cb 100644
--- a/repobee/main.py
+++ b/repobee/main.py
@@ -55,7 +55,7 @@ def main(sys_args: List[str]):
         if plugin_args:
             parsed_plugin_args = cli.parse_plugins(plugin_args)
             if parsed_plugin_args.no_plugins:
-                LOGGER.info("plugins disabled")
+                LOGGER.info("Plugins disabled")
             else:
                 plugin.initialize_plugins(parsed_plugin_args.plug)
         else:
@@ -73,7 +73,7 @@ def main(sys_args: List[str]):
             LOGGER.error(str(exc))
             if pre_init:
                 LOGGER.info(_PRE_INIT_ERROR_MESSAGE)
-            LOGGER.exception("critical exception")
+            LOGGER.exception("Critical exception")
         else:
             LOGGER.error("{.__class__.__name__}: {}".format(exc, str(exc)))
 
diff --git a/repobee/tuples.py b/repobee/tuples.py
index fc3f4ea..092a2a6 100644
--- a/repobee/tuples.py
+++ b/repobee/tuples.py
@@ -12,10 +12,6 @@ the goal is to collect all container types in this module.
 """
 from collections import namedtuple
 
-import daiquiri
-
-LOGGER = daiquiri.getLogger(__file__)
-
 Args = namedtuple(
     "Args",
     (


Test patch:
diff --git a/tests/unit_tests/plugin_tests/test_github.py b/tests/unit_tests/plugin_tests/test_github.py
index c19ffb2..a67017f 100644
--- a/tests/unit_tests/plugin_tests/test_github.py
+++ b/tests/unit_tests/plugin_tests/test_github.py
@@ -877,7 +877,7 @@ class TestVerifySettings:
             username + "other"
         )
         expected_messages = [
-            "specified login is {}, but the fetched user's login is {}".format(
+            "Specified login is {}, but the fetched user's login is {}".format(
                 USER, wrong_username
             ),
             "Possible reasons: unknown",