pygments-shell-console 0.7.1__tar.gz → 0.7.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pygments_shell_console-0.7.1 → pygments_shell_console-0.7.3}/PKG-INFO +1 -1
- {pygments_shell_console-0.7.1 → pygments_shell_console-0.7.3}/git_lexer.py +7 -7
- {pygments_shell_console-0.7.1 → pygments_shell_console-0.7.3}/pyproject.toml +1 -1
- {pygments_shell_console-0.7.1 → pygments_shell_console-0.7.3}/test/test_git_pretty_log.py +57 -0
- {pygments_shell_console-0.7.1 → pygments_shell_console-0.7.3}/.github/workflows/publish-to-pypi.yml +0 -0
- {pygments_shell_console-0.7.1 → pygments_shell_console-0.7.3}/.gitignore +0 -0
- {pygments_shell_console-0.7.1 → pygments_shell_console-0.7.3}/README.md +0 -0
- {pygments_shell_console-0.7.1 → pygments_shell_console-0.7.3}/examples/git_lg.example +0 -0
- {pygments_shell_console-0.7.1 → pygments_shell_console-0.7.3}/examples/git_log.example +0 -0
- {pygments_shell_console-0.7.1 → pygments_shell_console-0.7.3}/examples/git_show.example +0 -0
- {pygments_shell_console-0.7.1 → pygments_shell_console-0.7.3}/examples/status.example +0 -0
- {pygments_shell_console-0.7.1 → pygments_shell_console-0.7.3}/examples/test.exmpl +0 -0
- {pygments_shell_console-0.7.1 → pygments_shell_console-0.7.3}/examples/test.sh +0 -0
- {pygments_shell_console-0.7.1 → pygments_shell_console-0.7.3}/shellconsole_lexer.py +0 -0
- {pygments_shell_console-0.7.1 → pygments_shell_console-0.7.3}/shellconsole_style.py +0 -0
- {pygments_shell_console-0.7.1 → pygments_shell_console-0.7.3}/test/__init__.py +0 -0
- {pygments_shell_console-0.7.1 → pygments_shell_console-0.7.3}/test/test_git.py +0 -0
- {pygments_shell_console-0.7.1 → pygments_shell_console-0.7.3}/test/test_git_branch.py +0 -0
- {pygments_shell_console-0.7.1 → pygments_shell_console-0.7.3}/test/test_git_log.py +0 -0
- {pygments_shell_console-0.7.1 → pygments_shell_console-0.7.3}/test/test_git_merge.py +0 -0
- {pygments_shell_console-0.7.1 → pygments_shell_console-0.7.3}/test/test_git_show.py +0 -0
- {pygments_shell_console-0.7.1 → pygments_shell_console-0.7.3}/test/test_git_status.py +0 -0
- {pygments_shell_console-0.7.1 → pygments_shell_console-0.7.3}/test/test_prompts.py +0 -0
|
@@ -63,7 +63,7 @@ class GitLexer(RegexLexer):
|
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
class GitPrettyLogLexer(Lexer):
|
|
66
|
-
_branch_line_rgx = r'([\|\\\/ ]*)'
|
|
66
|
+
_branch_line_rgx = r'([\|\\\/ _]*)'
|
|
67
67
|
_logrgx_groups = [
|
|
68
68
|
_branch_line_rgx, # 1. Branch line
|
|
69
69
|
r'(\*)', # 2. Commit asterisk
|
|
@@ -74,13 +74,13 @@ class GitPrettyLogLexer(Lexer):
|
|
|
74
74
|
r'(-)', # 7. Commit separator
|
|
75
75
|
r'( +)', # 8. Space
|
|
76
76
|
r'(\([0-9A-Za-zÀ-ÖØ-öø-ÿ ]+\))', # 9. Date
|
|
77
|
-
r'(\s+)',
|
|
78
|
-
r'([
|
|
79
|
-
r'( +)',
|
|
80
|
-
r'(-)',
|
|
81
|
-
r'( +)',
|
|
77
|
+
r'(\s+)', # 10. Space
|
|
78
|
+
r'([^\n]+)', # 11. Commit message
|
|
79
|
+
r'( +)', # 12. Space
|
|
80
|
+
r'(-)', # 13. Commit separator
|
|
81
|
+
r'( +)', # 14. Space
|
|
82
82
|
r'([0-9A-Za-zÀ-ÖØ-öø-ÿ ]*[0-9A-Za-zÀ-ÖØ-öø-ÿ]+)', # 15. Author
|
|
83
|
-
r'( *)',
|
|
83
|
+
r'( *)', # 16. Space
|
|
84
84
|
r'((\([\w ->,:]+\))?)', # 17. Refs
|
|
85
85
|
r'\n', # End
|
|
86
86
|
]
|
|
@@ -220,3 +220,60 @@ def test_simple_git_log():
|
|
|
220
220
|
(Token.Git.CommitAuthor, "Joan Puigcerver"),
|
|
221
221
|
(Token.Text.Whitespace, "\n"),
|
|
222
222
|
]
|
|
223
|
+
|
|
224
|
+
def test_git_log_with_commit_message_commas():
|
|
225
|
+
lexer = ShellConsoleLexer()
|
|
226
|
+
text = (
|
|
227
|
+
"user@host:~/directory (main) $ git lg\n"
|
|
228
|
+
"* f853946 - (7 minutes ago) README: Afegits autors - Mar (main)\n"
|
|
229
|
+
"* 0fb88ef - (29 minutes ago) Canvis A, B i C - Joan Puigcerver"
|
|
230
|
+
)
|
|
231
|
+
|
|
232
|
+
tokens = list(lexer.get_tokens(text))
|
|
233
|
+
|
|
234
|
+
assert tokens == [
|
|
235
|
+
(Token.Generic.Prompt.UserHost, "user@host"),
|
|
236
|
+
(Token.Generic.Prompt, ":"),
|
|
237
|
+
(Token.Generic.Prompt.Directory, "~/directory"),
|
|
238
|
+
(Token.Generic.Prompt.Whitespace, " "),
|
|
239
|
+
(Token.Generic.Prompt.GitBranch, "(main)"),
|
|
240
|
+
(Token.Generic.Prompt.Whitespace, " "),
|
|
241
|
+
(Token.Generic.Prompt, "$"),
|
|
242
|
+
(Token.Generic.Prompt.Whitespace, " "),
|
|
243
|
+
(Token.Text, "git"),
|
|
244
|
+
(Token.Text.Whitespace, " "),
|
|
245
|
+
(Token.Text, "lg"),
|
|
246
|
+
(Token.Text.Whitespace, "\n"),
|
|
247
|
+
# First commit
|
|
248
|
+
(Token.Generic.Output, "*",),
|
|
249
|
+
(Token.Text.Whitespace, " "),
|
|
250
|
+
(Token.Git.CommitHash, "f853946"),
|
|
251
|
+
(Token.Text.Whitespace, " "),
|
|
252
|
+
(Token.Generic.Output, "-"),
|
|
253
|
+
(Token.Text.Whitespace, " "),
|
|
254
|
+
(Token.Git.CommitDate, "(7 minutes ago)"),
|
|
255
|
+
(Token.Text.Whitespace, " "),
|
|
256
|
+
(Token.Git.CommitMessage, "README: Afegits autors"),
|
|
257
|
+
(Token.Text.Whitespace, " "),
|
|
258
|
+
(Token.Generic.Output, "-"),
|
|
259
|
+
(Token.Text.Whitespace, " "),
|
|
260
|
+
(Token.Git.CommitAuthor, "Mar"),
|
|
261
|
+
(Token.Text.Whitespace, " "),
|
|
262
|
+
(Token.Git.Refs, "(main)"),
|
|
263
|
+
(Token.Text.Whitespace, "\n"),
|
|
264
|
+
# Second commit
|
|
265
|
+
(Token.Generic.Output, "*"),
|
|
266
|
+
(Token.Text.Whitespace, " "),
|
|
267
|
+
(Token.Git.CommitHash, "0fb88ef"),
|
|
268
|
+
(Token.Text.Whitespace, " "),
|
|
269
|
+
(Token.Generic.Output, "-"),
|
|
270
|
+
(Token.Text.Whitespace, " "),
|
|
271
|
+
(Token.Git.CommitDate, "(29 minutes ago)"),
|
|
272
|
+
(Token.Text.Whitespace, " "),
|
|
273
|
+
(Token.Git.CommitMessage, "Canvis A, B i C"),
|
|
274
|
+
(Token.Text.Whitespace, " "),
|
|
275
|
+
(Token.Generic.Output, "-"),
|
|
276
|
+
(Token.Text.Whitespace, " "),
|
|
277
|
+
(Token.Git.CommitAuthor, "Joan Puigcerver"),
|
|
278
|
+
(Token.Text.Whitespace, "\n"),
|
|
279
|
+
]
|
{pygments_shell_console-0.7.1 → pygments_shell_console-0.7.3}/.github/workflows/publish-to-pypi.yml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|