[vim/vim] runtime(python): Add f-string support (PR #14057)

34 views
Skip to first unread message

dkearns

unread,
Feb 19, 2024, 1:13:44 PM2/19/24
to vim/vim, Subscribed

This is an another possible fix for #14033 building on @A4-Tacks work in #14048.

This is a work in progress.


You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/14057

Commit Summary

  • 08cc022 runtime(python): Add f-string support

File Changes

(33 files)

Patch Links:


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/14057@github.com>

dkearns

unread,
Feb 19, 2024, 1:31:34 PM2/19/24
to vim/vim, Push

@dkearns pushed 1 commit.

  • 85d8d04 runtime(python): Add f-string support


View it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/14057/push/17162149392@github.com>

dkearns

unread,
Feb 20, 2024, 7:42:55 AM2/20/24
to vim/vim, Push

@dkearns pushed 1 commit.

  • 55c39a5 runtime(python): Add f-string support


View it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/14057/push/17174302488@github.com>

dkearns

unread,
Feb 20, 2024, 10:33:26 AM2/20/24
to vim/vim, Push

@dkearns pushed 1 commit.

  • 4515592 runtime(python): Add f-string support


View it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/14057/push/17177351024@github.com>

dkearns

unread,
Feb 20, 2024, 10:36:48 AM2/20/24
to vim/vim, Subscribed

I ran some automated syntax testing of this PR against Python-3.12.2/Lib and it doesn't appear to brake anything.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/14057/c1954481580@github.com>

Mikhail f. Shiryaev

unread,
Sep 27, 2024, 5:43:09 AM9/27/24
to vim/vim, Subscribed

It looks broken on the following code:

import logging
import os
from typing import Any


def git_runner(*args: Any, **kwargs: Any) -> str:
    "nothing"
    return str(*args, **kwargs)


GIT_PREFIX = "git"


def commit_push_staged(pr_info: Any) -> None:
    "nothing"
    # It works ONLY for PRs, and only over ssh, so either
    # ROBOT_CLICKHOUSE_SSH_KEY should be set or ssh-agent should work
    assert pr_info.number
    if not pr_info.head_name == pr_info.base_name:
        # We can't push to forks, sorry folks
        return
    git_staged = git_runner("git diff --cached --name-only")
    if not git_staged:
        logging.info("No fixes are staged")
        return

    def push_fix() -> None:
        """
        Stash staged changes to commit them on the top of the PR's head.
        `pull_request` event runs on top of a temporary merge_commit, we need to avoid
        including it in the autofix
        """
        remote_url = pr_info.event["pull_request"]["base"]["repo"]["ssh_url"]
        head = pr_info.sha
        git_runner(f"{GIT_PREFIX} commit -m 'Automatic style fix'")
        fix_commit = git_runner("git rev-parse HEAD")
        logging.info(
            "Fetching PR's head, check it out and cherry-pick autofix: %s", head
        )
        git_runner(
            f"{GIT_PREFIX} fetch {remote_url} --no-recurse-submodules --depth=1 {head}"
        )
        git_runner(f"git reset --hard {head}")
        git_runner(f"{GIT_PREFIX} cherry-pick {fix_commit}")
        git_runner(f"{GIT_PREFIX} push {remote_url} HEAD:{pr_info.head_ref}")

    if os.getenv("ROBOT_CLICKHOUSE_SSH_KEY", ""):
        push_fix()
        return

    push_fix()

image.png (view on web)


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/14057/c2378877088@github.com>

dkearns

unread,
Sep 27, 2024, 8:17:08 AM9/27/24
to vim/vim, Subscribed

You need to run it as a replacement for the distributed file, not applied additionally in your ~/.vim/after/syntax/ directory. So, just place it in ~/.vim/syntax (unedited).


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/14057/c2379138320@github.com>

dkearns

unread,
Sep 27, 2024, 8:27:22 AM9/27/24
to vim/vim, Push

@dkearns pushed 1 commit.

  • 6e64c27 runtime(python): Add f-string support


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/14057/before/451559280c96bba3f30e7c6ab380395b7d9ed647/after/6e64c27bbeb37494b3de0a87aa79e21fa7990cbd@github.com>

dkearns

unread,
Sep 27, 2024, 8:40:13 AM9/27/24
to vim/vim, Push

@dkearns pushed 1 commit.

  • 21c6d8b runtime(python): Add f-string support

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/14057/before/6e64c27bbeb37494b3de0a87aa79e21fa7990cbd/after/21c6d8b5b6ef510c9c78b9dfb89a41146599505f@github.com>

Mikhail f. Shiryaev

unread,
Sep 27, 2024, 4:03:33 PM9/27/24
to vim/vim, Subscribed

Installed the latest version from 21c6d8b as curl -s https://raw.githubusercontent.com/vim/vim/21c6d8b5b6ef510c9c78b9dfb89a41146599505f/runtime/syntax/python.vim > ~/.vim/syntax/python.vim, and it looks good. Thanks!


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/14057/c2379969561@github.com>

Mikhail f. Shiryaev

unread,
Sep 27, 2024, 4:42:00 PM9/27/24
to vim/vim, Subscribed

VAR = (
    "placeholderplaceholderplaceholderplaceholderplaceholderplaceholderplaceholder"
    if not bool()
    else f"placeholder {bool()}"
)
if not VAR:
    logging.debug("placeholder")
    _ = VAR

Another broken code. The closing curly brace there {bool()} is "unrelated" to the opening one.

image.png (view on web)


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/14057/c2380018924@github.com>

dkearns

unread,
Sep 28, 2024, 6:58:10 AM9/28/24
to vim/vim, Subscribed

WFM. Assuming you removed ~/.vim/after/syntax/python.vim are there any other custom syntax commands being applied?

The parens after bool shouldn't be highlighted either.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/14057/c2380602180@github.com>

Mikhail f. Shiryaev

unread,
Sep 28, 2024, 12:29:49 PM9/28/24
to vim/vim, Subscribed

Yes, it looks to be broken together with https://github.com/luochen1990/rainbow


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/14057/c2380738994@github.com>

Luo Chen

unread,
Sep 29, 2024, 6:00:40 AM9/29/24
to vim/vim, Subscribed

Yes, it looks to be broken together with https://github.com/luochen1990/rainbow

Replied here: luochen1990/rainbow#198


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/14057/c2381291956@github.com>

dkearns

unread,
Jun 16, 2025, 9:09:31 AM6/16/25
to vim/vim, Push

@dkearns pushed 1 commit.

  • 987337e runtime(python): Add f-string support

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/14057/before/21c6d8b5b6ef510c9c78b9dfb89a41146599505f/after/987337ecaec6c9099d2d2206624492bfafaac62d@github.com>

dkearns

unread,
Jul 12, 2025, 5:20:41 AM7/12/25
to vim/vim, Push

@dkearns pushed 1 commit.

  • 9930afc runtime(python): Add f-string support

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/14057/before/987337ecaec6c9099d2d2206624492bfafaac62d/after/9930afceb80c46708e72e4cae67bdac202d041da@github.com>

dkearns

unread,
Jul 12, 2025, 6:21:14 AM7/12/25
to vim/vim, Push

@dkearns pushed 1 commit.

  • ef81525 runtime(python): Add f-string support

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/14057/before/9930afceb80c46708e72e4cae67bdac202d041da/after/ef815254c6264c09b905617fa524b0151f489e84@github.com>

dkearns

unread,
Jul 12, 2025, 7:27:01 AM7/12/25
to vim/vim, Push

@dkearns pushed 1 commit.

  • 99a220d runtime(python): Add f-string support

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/14057/before/ef815254c6264c09b905617fa524b0151f489e84/after/99a220dfd890c980eb6fb15edbd0baf5a1ed7d50@github.com>

dkearns

unread,
Aug 16, 2025, 7:12:45 AM8/16/25
to vim/vim, Push

@dkearns pushed 1 commit.

  • 194cc9c runtime(python): Add f-string support

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/14057/before/99a220dfd890c980eb6fb15edbd0baf5a1ed7d50/after/194cc9cd9637f513ec2e57979ecd208c3c1d49df@github.com>

Reply all
Reply to author
Forward
0 new messages