Hey so, does anybody else intentionally leave comp...
# announcements
g
Hey so, does anybody else intentionally leave compiler errors on their branches while they're working so that when they come back to their work they'll have a tool telling them explicitly what they were working on? Is there a kotlin language feature that will let me do this? I figured some kind of use-anywhere style annotation might be more elegant. something like
@CompilerFailure("my custom message")
s
leave in errors on branches?
like are you checking in uncompilable code?
s
I guess, something like C preprocessor's #error
r
Why not just write what you should do? that will most likely result in a compile error as well.
g
You can just mark unfinished parts of code with TODO https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-t-o-d-o.html It is also supported in IJ Idea https://www.jetbrains.com/help/idea/todo-tool-window.html
a
Yup,
TODO("My custom message")
is what I use most of the time
Defining a type as the
Nothing
type is also nice. I use
Nothing
when I have yet to create that type.
c
a failing test or a test with
@Disabled
annotation
g
all of these suggestions are runtime errors, meaning I actually have to run something to encounter these messages. I want to hit the play button in intelliJ and, without any of my code running, have a message that tells me what to do
@Shawn yes I'm checking in uncompilable code on feature branches. We use a squash-and-rebase flow for feature branches when we merge, so you cant see them after the work is done.
c
when i hit the play button in idea it runs the test suite so my failing test will fail
a
TODO's give you a list you can access and jump to in Intellij. It will also warn you if you try to commit TODO's. It's not quite what you want since it does let you compile the code