diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4d1c7e4..4a58333 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,7 +11,7 @@ jobs: strategy: fail-fast: false matrix: - os: ["ubuntu-latest", "macos-latest"] + os: ["ubuntu-20.04", "macos-latest"] python: ["2.7", "pypy-2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "pypy-3.9"] include: - os: "windows-latest" @@ -21,12 +21,12 @@ jobs: - os: "windows-latest" python: "3.10" runs-on: ${{ matrix.os }} - name: "Python ${{ matrix.python }} on ${{ matrix.os }}" + name: "Test: Python ${{ matrix.python }} on ${{ matrix.os }}" steps: - uses: actions/checkout@v3 with: submodules: recursive - - uses: actions/setup-python@v3 + - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python }} - name: "Install dependencies" @@ -36,3 +36,10 @@ jobs: - name: "Run tests" run: | python -m tox + + fmt: + name: Format + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + - uses: psf/black@stable diff --git a/dotbot/plugins/shell.py b/dotbot/plugins/shell.py index 2ee0d68..4c8781e 100644 --- a/dotbot/plugins/shell.py +++ b/dotbot/plugins/shell.py @@ -40,10 +40,11 @@ class Shell(Plugin): else: cmd = item msg = None - if msg is None: + if quiet: + if msg is not None: + self._log.lowinfo("%s" % msg) + elif msg is None: self._log.lowinfo(cmd) - elif quiet: - self._log.lowinfo("%s" % msg) else: self._log.lowinfo("%s [%s]" % (msg, cmd)) stdout = options.get("stdout", stdout) diff --git a/tests/test_shell.py b/tests/test_shell.py index 9ae7a64..1744163 100644 --- a/tests/test_shell.py +++ b/tests/test_shell.py @@ -240,7 +240,7 @@ def test_shell_quiet_enabled_with_description(capfd, dotfiles, run_dotbot): def test_shell_quiet_enabled_without_description(capfd, dotfiles, run_dotbot): - """Verify the command is shown when quiet is enabled with no description.""" + """Verify nothing is shown when quiet is enabled with no description.""" dotfiles.write_config( [ @@ -258,4 +258,4 @@ def test_shell_quiet_enabled_without_description(capfd, dotfiles, run_dotbot): stdout = capfd.readouterr().out.splitlines() assert not any(line.startswith("banana") for line in stdout) - assert any(line.startswith("echo banana") for line in stdout) + assert not any(line.startswith("echo banana") for line in stdout) diff --git a/tests/test_shim.py b/tests/test_shim.py index 5d5fb28..4a137ca 100644 --- a/tests/test_shim.py +++ b/tests/test_shim.py @@ -42,7 +42,9 @@ def test_shim(root, home, dotfiles, run_dotbot): git_directory = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) os.chdir(dotfiles.directory) subprocess.check_call([git, "init"]) - subprocess.check_call([git, "submodule", "add", git_directory, "dotbot"]) + subprocess.check_call( + [git, "-c", "protocol.file.allow=always", "submodule", "add", git_directory, "dotbot"] + ) shutil.copy(install, shim) dotfiles.write("foo", "pear") dotfiles.write_config([{"link": {"~/.foo": "foo"}}])