Re:GitHub Super Linter: one linter to rule them all
by jlarocco on Thursday June 18, 2020 @09:09PM
(#23569991)
I suspect you're probably right, but that example isn't the greatest because Python 3 isn't source compatible with Python 2. The source code text itself isn't even backwards compatible in that case.
[ Parent
| on HN ]
Re:GitHub Super Linter: one linter to rule them all
by philsnow on Thursday June 18, 2020 @10:56PM
(#23570518)
That was maybe not a great example, pick any language change where a new keyword was introduced that wasn't previously a keyword or reserved word.
I tried to make an example with `with`, because that was introduced between 2.4 and 2.5 IIRC, and 2.4 and 2.5 aren't nearly as far apart as 2.* and 3.*, but I didn't find an easy way to install a 2.4 python (it didn't compile in pyenv on my mac, and I looked at a couple docker images before giving up).
Re:GitHub Super Linter: one linter to rule them all
by Dylan16807 on Friday June 19, 2020 @01:16AM
(#23571213)
But you're describing a benefit of storing an AST. Instead of the code suddenly changing meaning, you have an AST that says what the meaning should be.
The worst case is that you export it with the old version of the converter, and then the code changes meaning. You have silent corruption. But if you stored raw text this would always happen.
The good case is that you export it with the new version of the converter. It will notice that a variable name matches a keyword, and alert you to fix it.
Re:GitHub Super Linter: one linter to rule them all
by iso8859-1 on Thursday June 18, 2020 @11:01PM
(#23570539)
Since even minor releases can introduce new syntax that previously failed to parse, this happens more than just on major version numbers. For example: async/await, formatting string literals, underscores in numeric literals, the list goes on and on. So you'll have to upgrade your formatter. And when you upgrade it, it may start formatting something differently than it previously did, even if that chunk had no new syntax.
Re:GitHub Super Linter: one linter to rule them all
by Dylan16807 on Friday June 19, 2020 @01:05AM
(#23571142)
Use one that won't change how it formats on a whim?