Wouldn't quick sanity checks like these make more sense in a git push hook? No reason to wait for the CI. There's also the risk of broken intermediary commits unless the CI check each and every commit in isolation.
Grep one-liners as CI tasks
21–30 of 36 posts
Re: Grep one-liners as CI tasks
#22Here is my favorite: https://github.com/ClickHouse/ClickHouse/blob/master/utils/c... "Too many exclamation marks"
I wonder how they picked three as too many. Why not two? > Three shall be the number thou shalt count, and the number of the counting shall be three. Four shalt thou not count, neither count thou two, excepting that thou then proceed to three. Five is right out.
Re: Grep one-liners as CI tasks
#23Here is my favorite: https://github.com/ClickHouse/ClickHouse/blob/master/utils/c... "Too many exclamation marks"
I wonder how they picked three as too many. Why not two? > Three shall be the number thou shalt count, and the number of the counting shall be three. Four shalt thou not count, neither count thou two, excepting that thou then proceed to three. Five is right out.
!!41 === true
!!0 === falseRe: Grep one-liners as CI tasks
#24Re: Grep one-liners as CI tasks
#25Here is my favorite: https://github.com/ClickHouse/ClickHouse/blob/master/utils/c... "Too many exclamation marks"
Re: Grep one-liners as CI tasks
#26Here is my favorite: https://github.com/ClickHouse/ClickHouse/blob/master/utils/c... "Too many exclamation marks"
I wonder how they picked three as too many. Why not two? > Three shall be the number thou shalt count, and the number of the counting shall be three. Four shalt thou not count, neither count thou two, excepting that thou then proceed to three. Five is right out.
Re: Grep one-liners as CI tasks
#27Here is my favorite: https://github.com/ClickHouse/ClickHouse/blob/master/utils/c... "Too many exclamation marks"
I wonder how they picked three as too many. Why not two? > Three shall be the number thou shalt count, and the number of the counting shall be three. Four shalt thou not count, neither count thou two, excepting that thou then proceed to three. Five is right out.
Re: Grep one-liners as CI tasks
#28I think this is a great example of where build systems, that understand the need for testing, can help out. In a build system I use quite often (Bazel) you can express this as an `sh_test()` [0] which provides documentation about what you're attempting to do and provides you with a way to reproduce the failure locally. You don't have to push the code and wait for CI to fail to find out, or debug, this error. Extra fu…
The canonical example in my mind is any kind of autofix-able linter, where there's some kind of patch (or more nuanced autofix) that the linter can generate on-the-spot for you. With a sh_test construct (or any other test), you generally find yourself printing out some command that the user can run to fix things, which in a sufficiently large codebase can get really frustrating. (The worst offenders of this that I remember dealing with at Google were when generated code/artifacts had to be checked into the repo instead of getting being wired into the build system because and a large-scale change you were doing looked at one of them the wrong way...)
(My company - https://trunk.io - is actually building a universal linter as part of our product offering, and we already have a system to write custom linters with varying levels of sophistication that can plug into both your IDE and CI system!)
Re: Grep one-liners as CI tasks
#29I think this is a great example of where build systems, that understand the need for testing, can help out. In a build system I use quite often (Bazel) you can express this as an `sh_test()` [0] which provides documentation about what you're attempting to do and provides you with a way to reproduce the failure locally. You don't have to push the code and wait for CI to fail to find out, or debug, this error. Extra fu…
Tests are a good way to assert an invariant that you expect of your codebase, but as with all things, resolving the error can get a bit tricky/frustrating. The canonical example in my mind is any kind of autofix-able linter, where there's some kind of patch (or more nuanced autofix) that the linter can generate on-the-spot for you. With a sh_test construct (or any other test), you generally find yourself printing out…
I’ve yet to see a good answer to this problem though as each approach has upsides/downsides and no one ever ends up happy in a large enough team. Good luck.
Re: Grep one-liners as CI tasks
#30I think this is a great example of where build systems, that understand the need for testing, can help out. In a build system I use quite often (Bazel) you can express this as an `sh_test()` [0] which provides documentation about what you're attempting to do and provides you with a way to reproduce the failure locally. You don't have to push the code and wait for CI to fail to find out, or debug, this error. Extra fu…