checker of using python2

瀏覽次數:75 次
跳到第一則未讀訊息

MURAOKA Taro

未讀,
2017年1月14日 晚上10:08:552017/1/14
收件者:vim_dev、Bram Moolenaar
Hi the list and Bram.

I suggest to add checker of using Python 2.x

Python 2 will be retire 2020, and it is not so far.
https://pythonclock.org/
To stop using Python 2.x suddenly is not easy for Vim users.
Because it is difficult to know which scripts are using Python 2.
So vim may help to detect it.

I have wrote a patch for proof of the concept.
Please check it:
https://gist.github.com/koron/90f6b56b73c211e059a3b8ab1db335a9

My patch do three things:

1. Show a waring message at only once when Python 2.x is used.
2. The warning could be suppressed by 'nopy2warn' option.
3. :py2usingfrom shows list of files which use Python 2.x

Names for command and option which I added are not good, I think.
Please replace those by better names.

Best.
--
MURAOKA Taro <koron....@gmail.com>

Bram Moolenaar

未讀,
2017年1月15日 清晨7:54:152017/1/15
收件者:MURAOKA Taro、vim_dev、Bram Moolenaar
Can be useful, if the user cares about avoiding Python 2.
But it should not warn by default.

It should be possible to add a flag in scriptitem_T. And the line
number would be useful too. The sourcing_lnum has the value.

--
MAN: You don't frighten us, English pig-dog! Go and boil your bottoms,
son of a silly person. I blow my nose on you, so-called Arthur-king,
you and your silly English K...kaniggets.
He puts hands to his ears and blows a raspberry.
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

MURAOKA Taro

未讀,
2017年1月15日 上午9:47:322017/1/15
收件者:Bram Moolenaar、vim_dev
Thank you for comments.
I'll try to improve ;)
--
MURAOKA Taro <koron....@gmail.com>
回覆所有人
回覆作者
轉寄
0 則新訊息