internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: pre-commit/pre-commit

Issue:
Handle when `core.hooksPath` is set?
As we found in https://github.com/pre-commit/pre-commit-hooks/issues/250, pre-commit (despite being installed) will be silently skipped if `core.hooksPath` is set.

A few options:
- during `pre-commit install`, check this variable and warn
- "" but error
- install into the directory at `core.hooksPath` (but it may be outside the working dir? probably not the best idea to write to it)


Discussion:
Or a prompt when running `pre-commit install` along the lines of:

> We noticed that you have set a different directory for the git hooks via the `core.hooksPath` config. Do you want us to remove it so `pre-commit` will work or install it in the specified directory?

Resolving patch:
diff --git a/pre_commit/commands/install_uninstall.py b/pre_commit/commands/install_uninstall.py
--- a/pre_commit/commands/install_uninstall.py
+++ b/pre_commit/commands/install_uninstall.py
@@ -2,15 +2,19 @@
 from __future__ import unicode_literals
 
 import io
+import logging
 import os.path
 import sys
 
 from pre_commit import output
+from pre_commit.util import cmd_output
 from pre_commit.util import make_executable
 from pre_commit.util import mkdirp
 from pre_commit.util import resource_filename
 
 
+logger = logging.getLogger(__name__)
+
 # This is used to identify the hook file we install
 PRIOR_HASHES = (
     '4d9958c90bc262f47553e2c073f14cfe',
@@ -36,6 +40,13 @@ def install(
         skip_on_missing_conf=False,
 ):
     """Install the pre-commit hooks."""
+    if cmd_output('git', 'config', 'core.hooksPath', retcode=None)[1].strip():
+        logger.error(
+            'Cowardly refusing to install hooks with `core.hooksPath` set.\n'
+            'hint: `git config --unset-all core.hooksPath`',
+        )
+        return 1
+
     hook_path = runner.get_hook_path(hook_type)
     legacy_path = hook_path + '.legacy'
 


Test patch:
diff --git a/tests/commands/install_uninstall_test.py b/tests/commands/install_uninstall_test.py
--- a/tests/commands/install_uninstall_test.py
+++ b/tests/commands/install_uninstall_test.py
@@ -66,6 +66,14 @@ def test_install_hooks_directory_not_present(tempdir_factory):
     assert os.path.exists(runner.pre_commit_path)
 
 
+def test_install_refuses_core_hookspath(tempdir_factory):
+    path = git_dir(tempdir_factory)
+    with cwd(path):
+        cmd_output('git', 'config', '--local', 'core.hooksPath', 'hooks')
+        runner = Runner(path, C.CONFIG_FILE)
+        assert install(runner)
+
+
 @xfailif_no_symlink
 def test_install_hooks_dead_symlink(
         tempdir_factory,
Repository: pre-commit/pre-commit

Issue:
`stages: [commit]` hooks will run with `pre-commit run otherhookid`
minor logic bug, good new-contributor ticket

Easy to reproduce on pre-commit itself:

```diff
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index a146bd2..7bb382d 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -3,6 +3,7 @@ repos:
     rev: v1.2.3
     hooks:
     -   id: trailing-whitespace
+        stages: [commit]
     -   id: end-of-file-fixer
     -   id: autopep8-wrapper
     -   id: check-docstring-first
```

```console
$ pre-commit run end-of-file-fixer --all-files
Trim Trailing Whitespace.................................................Passed
Fix End of Files.........................................................Passed
```

(it should have only run `end-of-file-fixer` but also run `trailing-whitespace` due to a logic error).


Discussion:

Resolving patch:
diff --git a/pre_commit/commands/run.py b/pre_commit/commands/run.py
--- a/pre_commit/commands/run.py
+++ b/pre_commit/commands/run.py
@@ -256,7 +256,7 @@ def run(runner, store, args, environ=os.environ):
             for _, hook in repo.hooks:
                 if (
                     (not args.hook or hook['id'] == args.hook) and
-                    not hook['stages'] or args.hook_stage in hook['stages']
+                    (not hook['stages'] or args.hook_stage in hook['stages'])
                 ):
                     repo_hooks.append((repo, hook))
 


Test patch:
diff --git a/tests/commands/run_test.py b/tests/commands/run_test.py
--- a/tests/commands/run_test.py
+++ b/tests/commands/run_test.py
@@ -762,3 +762,34 @@ def test_include_exclude_does_search_instead_of_match(some_filenames):
 def test_include_exclude_exclude_removes_files(some_filenames):
     ret = _filter_by_include_exclude(some_filenames, '', r'\.py$')
     assert ret == ['.pre-commit-hooks.yaml']
+
+
+def test_args_hook_only(cap_out, store, repo_with_passing_hook):
+    config = OrderedDict((
+        ('repo', 'local'),
+        (
+            'hooks', (
+                OrderedDict((
+                    ('id', 'flake8'),
+                    ('name', 'flake8'),
+                    ('entry', "'{}' -m flake8".format(sys.executable)),
+                    ('language', 'system'),
+                    ('stages', ['commit']),
+                )), OrderedDict((
+                    ('id', 'do_not_commit'),
+                    ('name', 'Block if "DO NOT COMMIT" is found'),
+                    ('entry', 'DO NOT COMMIT'),
+                    ('language', 'pygrep'),
+                )),
+            ),
+        ),
+    ))
+    add_config_to_repo(repo_with_passing_hook, config)
+    stage_a_file()
+    ret, printed = _do_run(
+        cap_out,
+        store,
+        repo_with_passing_hook,
+        run_opts(hook='do_not_commit'),
+    )
+    assert b'flake8' not in printed
Repository: pre-commit/pre-commit

Issue:
Create `language: fail` for filename-only checks
For example, it would be useful here:

https://github.com/pytest-dev/pytest/pull/3765/files

v1 could just print the filenames and exit nonzero, potentially with a `--message` option.


Discussion:
+1, here's another case where this could be useful:

https://github.com/ocf/ocfweb/blob/f166a3159da560eb871ebd3a375606ba5a240912/.pre-commit-config.yaml#L67-L71

Resolving patch:
diff --git a/pre_commit/languages/all.py b/pre_commit/languages/all.py
--- a/pre_commit/languages/all.py
+++ b/pre_commit/languages/all.py
@@ -2,6 +2,7 @@
 
 from pre_commit.languages import docker
 from pre_commit.languages import docker_image
+from pre_commit.languages import fail
 from pre_commit.languages import golang
 from pre_commit.languages import node
 from pre_commit.languages import pcre
@@ -54,6 +55,7 @@
 languages = {
     'docker': docker,
     'docker_image': docker_image,
+    'fail': fail,
     'golang': golang,
     'node': node,
     'pcre': pcre,
diff --git a/pre_commit/languages/fail.py b/pre_commit/languages/fail.py
new file mode 100644
--- /dev/null
+++ b/pre_commit/languages/fail.py
@@ -0,0 +1,15 @@
+from __future__ import unicode_literals
+
+from pre_commit.languages import helpers
+
+
+ENVIRONMENT_DIR = None
+get_default_version = helpers.basic_get_default_version
+healthy = helpers.basic_healthy
+install_environment = helpers.no_install
+
+
+def run_hook(prefix, hook, file_args):
+    out = hook['entry'].encode('UTF-8') + b'\n\n'
+    out += b'\n'.join(f.encode('UTF-8') for f in file_args) + b'\n'
+    return 1, out, b''


Test patch:
diff --git a/tests/repository_test.py b/tests/repository_test.py
--- a/tests/repository_test.py
+++ b/tests/repository_test.py
@@ -589,6 +589,29 @@ def test_local_rust_additional_dependencies(store):
     assert _norm_out(ret[1]) == b"Hello World!\n"
 
 
+def test_fail_hooks(store):
+    config = {
+        'repo': 'local',
+        'hooks': [{
+            'id': 'fail',
+            'name': 'fail',
+            'language': 'fail',
+            'entry': 'make sure to name changelogs as .rst!',
+            'files': r'changelog/.*(?<!\.rst)$',
+        }],
+    }
+    repo = Repository.create(config, store)
+    (_, hook), = repo.hooks
+    ret = repo.run_hook(hook, ('changelog/1234.bugfix', 'changelog/wat'))
+    assert ret[0] == 1
+    assert ret[1] == (
+        b'make sure to name changelogs as .rst!\n'
+        b'\n'
+        b'changelog/1234.bugfix\n'
+        b'changelog/wat\n'
+    )
+
+
 def test_reinstall(tempdir_factory, store, log_info_mock):
     path = make_repo(tempdir_factory, 'python_hooks_repo')
     config = make_config_from_repo(path)
Repository: pre-commit/pre-commit

Issue:
git.get_git_dir() appears to break with older versions of git
When you install the current pre-commit (v1.11.0) on a system using an older git, eg 2.1.4, the `git rev-parse --git-common-dir` ultimately issued by `git.get_git_dir()` yields the result `--git-common-dir` instead of `.git` like you'd expect. This causes pre-commit to get installed in a directory literally named "--git-common-dir", and thus not work.

Happened to encounter using a docker image for an older version of python, which used an older git. Examples to demo the issue:

```
$ docker run python:2.7.9 sh -c "git init foo && cd foo && git rev-parse --git-common-dir && git --version"
Initialized empty Git repository in /foo/.git/
--git-common-dir
git version 2.1.4
$ docker run python:2.7.15 sh -c "git init foo && cd foo && git rev-parse --git-common-dir && git --version"
Initialized empty Git repository in /foo/.git/
.git
git version 2.11.0
```

In git.get_git_dir() as it stands, it appears that the older-git behavior is anticipated. It looks like older gits are expected to throw a `CalledProcessError` when `git rev-parse --git-common-dir` is called, and fall back to `git rev-parse --git-dir`. But evidently that's not working as intended?


Discussion:
yikes!  Thanks for the report I'll get a fix for this

Looks like this was depending on the PARSEOPT mode of `rev-parse` which isn't the default
This is a regression introduced in [v1.10.5](https://github.com/pre-commit/pre-commit/releases/tag/v1.10.5)
actually hmm, parseopt seems insufficient as well

Resolving patch:
diff --git a/pre_commit/git.py b/pre_commit/git.py
--- a/pre_commit/git.py
+++ b/pre_commit/git.py
@@ -31,16 +31,13 @@ def get_root():
 
 
 def get_git_dir(git_root):
-    def _git_dir(opt):
-        return os.path.normpath(os.path.join(
-            git_root,
-            cmd_output('git', 'rev-parse', opt, cwd=git_root)[1].strip(),
-        ))
-
-    try:
-        return _git_dir('--git-common-dir')
-    except CalledProcessError:  # pragma: no cover (git < 2.5)
-        return _git_dir('--git-dir')
+    opts = ('--git-common-dir', '--git-dir')
+    _, out, _ = cmd_output('git', 'rev-parse', *opts, cwd=git_root)
+    for line, opt in zip(out.splitlines(), opts):
+        if line != opt:  # pragma: no branch (git < 2.5)
+            return os.path.normpath(os.path.join(git_root, line))
+    else:
+        raise AssertionError('unreachable: no git dir')
 
 
 def get_remote_url(git_root):


Test patch:
Repository: pre-commit/pre-commit

Issue:
"identity" meta hook
Pretty often I or a bug reporter reaches for the "simplest hook possible" -- often to debug what files are being passed through.

Let's add an "identity" hook which does the following:

1. Is always verbose
2. prints the filenames passed to it
3. Always succeeds

Basically make something like this, but without depending on "actual" `echo`:

```yaml
-   id: identity
    name: identity
    entry: echo
    verbose: true
    language: system
```


Discussion:

Resolving patch:
diff --git a/pre_commit/meta_hooks/identity.py b/pre_commit/meta_hooks/identity.py
new file mode 100644
--- /dev/null
+++ b/pre_commit/meta_hooks/identity.py
@@ -0,0 +1,13 @@
+import sys
+
+from pre_commit import output
+
+
+def main(argv=None):
+    argv = argv if argv is not None else sys.argv[1:]
+    for arg in argv:
+        output.write_line(arg)
+
+
+if __name__ == '__main__':
+    exit(main())
diff --git a/pre_commit/repository.py b/pre_commit/repository.py
--- a/pre_commit/repository.py
+++ b/pre_commit/repository.py
@@ -237,6 +237,7 @@ def manifest_hooks(self):
         # The hooks are imported here to prevent circular imports.
         from pre_commit.meta_hooks import check_hooks_apply
         from pre_commit.meta_hooks import check_useless_excludes
+        from pre_commit.meta_hooks import identity
 
         def _make_entry(mod):
             """the hook `entry` is passed through `shlex.split()` by the
@@ -260,6 +261,13 @@ def _make_entry(mod):
                 'language': 'system',
                 'entry': _make_entry(check_useless_excludes),
             },
+            {
+                'id': 'identity',
+                'name': 'identity',
+                'language': 'system',
+                'verbose': True,
+                'entry': _make_entry(identity),
+            },
         ]
 
         return {


Test patch:
diff --git a/tests/meta_hooks/identity_test.py b/tests/meta_hooks/identity_test.py
new file mode 100644
--- /dev/null
+++ b/tests/meta_hooks/identity_test.py
@@ -0,0 +1,6 @@
+from pre_commit.meta_hooks import identity
+
+
+def test_identity(cap_out):
+    assert not identity.main(('a', 'b', 'c'))
+    assert cap_out.get() == 'a\nb\nc\n'
Repository: pre-commit/pre-commit

Issue:
Support GIT_SSH_COMMAND
Currently, `GIT_SSH` is supported for overriding the git command, but it is is sightly less ergonomic than `GIT_SSH_COMMAND` since it requires file. Adding support for passing `GIT_SSH_COMMAND` to git commands would obviate the need for creating a new file when you want to change the ssh command.


Discussion:
going to be honest, I have no idea what you're talking about -- could you elaborate?
Docs for both of these https://git-scm.com/docs/git#git-codeGITSSHcode
Code where pre-commit only allows GIT_SSH: https://github.com/pre-commit/pre-commit/blob/46ae88c1f06b8dc59f3e049c68b2dcea22bb9a54/pre_commit/git.py#L32
As for use case, I'm using this to point at a weirdly-placed ssh key.
ah ok now I understand.  seems fine, go for it

that said, you can also configure this through `IdentityFile` in `~/.ssh/config` -- but `GIT_SSH_COMMAND` seems harmless to whitelist here
There's a lot of complex other reasons I can't really use `~/.ssh/config`. I'll cut a quick branch for this.

Resolving patch:
diff --git a/pre_commit/git.py b/pre_commit/git.py
--- a/pre_commit/git.py
+++ b/pre_commit/git.py
@@ -29,7 +29,7 @@ def no_git_env():
     # GIT_INDEX_FILE: Causes 'error invalid object ...' during commit
     return {
         k: v for k, v in os.environ.items()
-        if not k.startswith('GIT_') or k in {'GIT_SSH'}
+        if not k.startswith('GIT_') or k in {'GIT_SSH', 'GIT_SSH_COMMAND'}
     }
 
 


Test patch:
Repository: pre-commit/pre-commit

Issue:
cspell hook install fails due pre-commit assumptions regarding npm packages
I am raising this bug here as cspell is still unusable as a pre-commit hook even after the author made additional changes and I am afraid that the root cause is no longer inside cspell package.

Mainly cspell is a typescript project that is published on npm and you cannot run it without building it first. Apparently pre-commit does not know about this concenpt (or I am not aware about it).'

More information can be found on https://github.com/Jason3S/cspell/issues/53#issuecomment-402562237

To enabled cspell hook it should be enough to add this:
```
  - repo: https://github.com/Jason3S/cspell.git
    rev: v3.2.2
    hooks:
      - id: cspell
```

Still, once you run pre-precommit you soon endup with something like:
```
cspell...................................................................Failed
hookid: cspell

internal/modules/cjs/loader.js:611
    throw err;
    ^

Error: Cannot find module './dist/app'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:609:15)
    at Function.Module._load (internal/modules/cjs/loader.js:535:25)
    at Module.require (internal/modules/cjs/loader.js:663:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.<anonymous> (/Users/ssbarnea/.cache/pre-commit/repolvipoC/bin.js:5:1)
    at Module._compile (internal/modules/cjs/loader.js:734:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:745:10)
    at Module.load (internal/modules/cjs/loader.js:626:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:566:12)
    at Function.Module._load (internal/modules/cjs/loader.js:558:3)
internal/modules/cjs/loader.js:611
    throw err;
    ^
```

The maintainer of cspell mentioned that the project was not designed to run from source, and the expected behavior is to install the npm package. I have to say that I kinda agree with his view.

How can we address this issue? 


Discussion:
you can use a local hook. That cspell doesn't install from source is really their bug
hmm oddly enough `npm install git+https://github.com/Jason3S/cspell` seems to work fine.  I'm confused why npm would treat that differently than `git clone https://github.com/Jason3S/cspell && cd cspell && npm install .` -- maybe there's something I can hack to get the same behaviour?
Made a support issue about it: https://npm.community/t/npm-install-g-git-vs-git-clone-cd-npm-install-g/5449

Resolving patch:
diff --git a/pre_commit/languages/node.py b/pre_commit/languages/node.py
--- a/pre_commit/languages/node.py
+++ b/pre_commit/languages/node.py
@@ -62,10 +62,11 @@ def install_environment(prefix, version, additional_dependencies):
             cmd.extend(['-n', version])
         cmd_output(*cmd)
 
+        dep = 'git+file:///{}'.format(prefix.prefix_dir)
         with in_env(prefix, version):
             helpers.run_setup_cmd(
                 prefix,
-                ('npm', 'install', '-g', '.') + additional_dependencies,
+                ('npm', 'install', '-g', dep) + additional_dependencies,
             )
 
 


Test patch:
Repository: pre-commit/pre-commit

Issue:
Error when building RPM
When building RPM for Fedora i got this:

`*** ERROR: ambiguous python shebang in /usr/lib/python3.7/site-packages/pre_commit/resources/hook-tmpl: #!/usr/bin/env python. Change it to python3 (or python2) explicitly.`

Would be great if this fixed.


Discussion:
The value there doesn't actually matter, it gets replaced out when the file is created on `pre-commit install` [here](https://github.com/pre-commit/pre-commit/blob/da00fa98f9e274e2d3ef8f756566f1946dc79e36/pre_commit/commands/install_uninstall.py#L110) - for now it's purpose is mostly for editor / linter integration

If you'd like to make a PR, changing it to `env python3` will work if you change both references 👍 

Resolving patch:
diff --git a/pre_commit/commands/install_uninstall.py b/pre_commit/commands/install_uninstall.py
--- a/pre_commit/commands/install_uninstall.py
+++ b/pre_commit/commands/install_uninstall.py
@@ -107,7 +107,7 @@ def install(
         before, rest = contents.split(TEMPLATE_START)
         to_template, after = rest.split(TEMPLATE_END)
 
-        before = before.replace('#!/usr/bin/env python', shebang())
+        before = before.replace('#!/usr/bin/env python3', shebang())
 
         hook_file.write(before + TEMPLATE_START)
         for line in to_template.splitlines():


Test patch:
Repository: pre-commit/pre-commit

Issue:
--show-diff-on-failure does not respect --color
I'm running `pre-commit` on gitlab, and I noticed that the diffs produced when `--show-diff-on-failure` is enabled do not respect `--color=always`.  

It looks like a pretty easy fix:   we just need to pass the `--color` setting to `git diff`.  It supports the same "auto", "always", "never" settings as `pre-commit`.  

`git diff --color` [documentation](https://git-scm.com/docs/git-diff#Documentation/git-diff.txt---colorltwhengt).

code in question: https://github.com/pre-commit/pre-commit/blob/master/pre_commit/commands/run.py#L227



Discussion:
want to submit a PR?
Sure!
@chadrik ping!
@chadrik If you are busy/not working on this, can I give it a try ? 
I came here looking for "good-first-issue"
@mandarvaze I say go for it 👍  -- let me know if you want some more directed pointers about where this code is and what to pass through :)
Hi, sorry I’ve been busy.  Please feel free to go for it!

On Thu, May 30, 2019 at 6:36 AM Anthony Sottile <notifications@github.com>
wrote:

> @mandarvaze <https://github.com/mandarvaze> I say go for it 👍 -- let me
> know if you want some more directed pointers about where this code is and
> what to pass through :)
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <https://github.com/pre-commit/pre-commit/issues/1007?email_source=notifications&email_token=AAAPOE3WP4KF7FRAT5FDFCDPX7J4HA5CNFSM4HIGG5FKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODWSKZSI#issuecomment-497331401>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AAAPOE42VKQADBBVSM3HZ5DPX7J4HANCNFSM4HIGG5FA>
> .
>


Resolving patch:
diff --git a/pre_commit/commands/run.py b/pre_commit/commands/run.py
--- a/pre_commit/commands/run.py
+++ b/pre_commit/commands/run.py
@@ -224,7 +224,13 @@ def _run_hooks(config, hooks, args, environ):
                 '`pre-commit install`.',
             )
         output.write_line('All changes made by hooks:')
-        subprocess.call(('git', '--no-pager', 'diff', '--no-ext-diff'))
+        # args.color is a boolean.
+        # See user_color function in color.py
+        subprocess.call((
+            'git', '--no-pager', 'diff', '--no-ext-diff',
+            '--color={}'.format({True: 'always', False: 'never'}[args.color]),
+        ))
+
     return retval
 
 


Test patch:
diff --git a/tests/commands/run_test.py b/tests/commands/run_test.py
--- a/tests/commands/run_test.py
+++ b/tests/commands/run_test.py
@@ -187,6 +187,13 @@ def test_global_exclude(cap_out, store, tempdir_factory):
             },
             b'All changes made by hooks:',
         ),
+        (
+            {
+                'show_diff_on_failure': True,
+                'color': True,
+            },
+            b'All changes made by hooks:',
+        ),
         (
             {
                 'show_diff_on_failure': True,
Repository: pre-commit/pre-commit

Issue:
Globally disable color?
I cannot find the way to globally disable color in the pre-commit output. Setting only the background color to green and not changing the foreground color does not work for my terminal with the following settings in the Xt resources (as set in the `${HOME}/.Xresources` file):

````properties
Rxvt.background: black
Rxvt.foreground: deepSkyBlue
````

Is there a way? It would be great to respect https://no-color.org/ environment variable. And, while we are here, maybe understand the following git config setting:

````ini
[color]
        ui = never
````



Discussion:
There's [`--color`](https://pre-commit.com/#cli)
Thanks, how do i do this from the git pre-commit hook?
currently not an option afaik
@saper would you like to implement `$NO_COLOR` or some such? shouldn't be too difficult to plug in [here](https://github.com/pre-commit/pre-commit/blob/95afd642f52b4d2a12ad605683c8f752e63530d0/pre_commit/color.py#L42-L54)

Resolving patch:
diff --git a/pre_commit/color.py b/pre_commit/color.py
--- a/pre_commit/color.py
+++ b/pre_commit/color.py
@@ -48,6 +48,9 @@ def use_color(setting):
     if setting not in COLOR_CHOICES:
         raise InvalidColorSetting(setting)
 
+    if os.environ.get('NO_COLOR'):
+        return False
+
     return (
         setting == 'always' or
         (setting == 'auto' and sys.stdout.isatty() and terminal_supports_color)


Test patch:
diff --git a/tests/color_test.py b/tests/color_test.py
--- a/tests/color_test.py
+++ b/tests/color_test.py
@@ -1,5 +1,6 @@
 from __future__ import unicode_literals
 
+import os
 import sys
 
 import mock
@@ -50,3 +51,18 @@ def test_use_color_tty_without_color_support():
 def test_use_color_raises_if_given_shenanigans():
     with pytest.raises(InvalidColorSetting):
         use_color('herpaderp')
+
+
+def test_no_color_env_unset():
+    with mock.patch.dict(os.environ, clear=True):
+        assert use_color('always') is True
+
+
+def test_no_color_env_empty():
+    with mock.patch.dict(os.environ, NO_COLOR=''):
+        assert use_color('always') is True
+
+
+def test_no_color_env_non_empty():
+    with mock.patch.dict(os.environ, NO_COLOR=' '):
+        assert use_color('always') is False