File tree 2 files changed +9
-7
lines changed
2 files changed +9
-7
lines changed Original file line number Diff line number Diff line change 1
- import re
2
1
import os
2
+ import re
3
3
from pathlib import Path
4
4
from tempfile import NamedTemporaryFile
5
5
from typing import List , Optional
Original file line number Diff line number Diff line change 1
1
import os
2
-
3
2
import re
3
+
4
4
import pytest
5
5
6
6
from commitizen import cmd , defaults
@@ -26,8 +26,8 @@ def tmp_commitizen_project(tmp_git_project):
26
26
27
27
@pytest .fixture (scope = "function" )
28
28
def tmp_commitizen_project_with_gpg (tmp_commitizen_project ):
29
- _gpg_file = tmp_commitizen_project .join (' gpg_setup' )
30
- with open (_gpg_file , "w" , newline = '' ) as f :
29
+ _gpg_file = tmp_commitizen_project .join (" gpg_setup" )
30
+ with open (_gpg_file , "w" , newline = "" ) as f :
31
31
f .write ("Key-Type: default" + os .linesep )
32
32
f .write ("Subkey-Type: default" + os .linesep )
33
33
f .write ("Name-Real: Joe Tester" + os .linesep )
@@ -38,9 +38,11 @@ def tmp_commitizen_project_with_gpg(tmp_commitizen_project):
38
38
39
39
cmd .run (f"gpg --batch --generate-key { _gpg_file } " )
40
40
41
- _new_key = cmd .run (f"gpg --list-secret-keys joe@foo.bar" )
42
- _m = re .search (f"[a-zA-Z0-9 \[\]-_]*{ os .linesep } [ ]*([0-9A-Za-z]*){ os .linesep } [{ os .linesep } a-zA-Z0-9 \[\]-_<>@]*" ,
43
- _new_key .out )
41
+ _new_key = cmd .run ("gpg --list-secret-keys joe@foo.bar" )
42
+ _m = re .search (
43
+ rf"[a-zA-Z0-9 \[\]-_]*{ os .linesep } [ ]*([0-9A-Za-z]*){ os .linesep } [{ os .linesep } a-zA-Z0-9 \[\]-_<>@]*" ,
44
+ _new_key .out ,
45
+ )
44
46
if _m :
45
47
_key_id = _m .group (1 )
46
48
cmd .run ("git config --global commit.gpgsign true" )
You can’t perform that action at this time.
0 commit comments