runtime(python): Add f-string support - #14057
Conversation
3401f52 to
4515592
Compare
|
I ran some automated syntax testing of this PR against |
|
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() |
|
You need to run it as a replacement for the distributed file, not applied additionally in your |
6e64c27 to
21c6d8b
Compare
|
Installed the latest version from 21c6d8b as |
|
WFM. Assuming you removed The parens after bool shouldn't be highlighted either. |
|
Yes, it looks to be broken together with https://github.com/luochen1990/rainbow Is it something that I should bring to the plugin repo to address? As far as I get, the work here is not over yet. |
Replied here: luochen1990/rainbow#198 |
21c6d8b to
987337e
Compare
ef81525 to
99a220d
Compare
Fixes vim#14033. Signed-off-by: Doug Kearns <dougkearns@gmail.com>
99a220d to
194cc9c
Compare
|
It looks like everything this covered is now supported in |
|
thanks, closing then. |



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