• Stars
    star
    109
  • Rank 319,077 (Top 7 %)
  • Language
    Kotlin
  • Created over 12 years ago
  • Updated 7 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

IntelliJ plugin to limit your work-in-progress

Build Status

Limited WIP

This is a plugin for IntelliJ IDEs to limit work-in-progress (WIP) by adding constraints to your normal workflow in IDE.

It has three main components (each one can be enabled/disabled):

  • Change size watchdog: shows notifications when current changelist size exceeds threshold
  • Auto-revert: automatically reverts current changelist after a timeout (the timer is reset after each commit)
  • TCR mode (test && commit || revert): you can only commit after running a test; if the test fails, current changelist is reverted; if the test passes, changes are automatically committed

Why?

  • focus on one thing at a time, make really small steps and commit as soon as you're done
  • practice various constraints as if you're at a code retreat
  • explore your limits and learn new refactoring, coding and problem solving techniques

Change size watchdog

Whenever size of the current change list exceeds specified threshold, watchdog will show notification popup reminding to reduce amount of changes. This is the least extreme constraint and has been used on large scale enterprise projects.

You can find settings in Preferences -> Other Settings -> Limited WIP, where you can:

  • enable/disable component
  • change size threshold which is measured as the amount of lines changed ignoring empty lines (if file was deleted, then the amount of lines in the file). There are no particular reasons for the predefined thresholds of 40, 80, 100, 120. These numbers are just a guess.
  • notification interval, i.e. how often watchdog will nag you after exceeding threshold
  • enable/disable statusbar widget showing current change size and change size threshold, e.g. Change size: 50/80 means that change size is 50 and threshold is 80. You can click on the widget to suppress notifications until next commit.
  • enable/disable commits after change size exceeded threshold. If enabled and change size is above threshold, you will not be able to open commit dialog and will see notification popup instead (although you can still force commit by clicking on the link in the popup).
  • choose excluded files which will not be monitored by the watchdog. Use ; to separate patterns. Accepted wildcards: ? - exactly one symbol; * - zero or more symbols; / - path separator; /**/ - any number of directories.

Auto-revert

  • Timer starts as soon as there are any changes in version control.
  • Timer resets when there are no more changes (because of commit, revert or undo).
  • When timer reaches 0 seconds, all changes are automatically reverted.

This constraint has been used at code retreats with 5 minute timeout for quite a few years. It has been useful on large scale enterprise projects with longer timeouts (e.g. 30, 60, 120 minutes). And it also seems to work well in combination with TCR.

You can find settings in Preferences -> Other Settings -> Limited WIP, where you can:

  • enable/disable component (it is disabled by default)
  • timeout until revert in minutes or seconds
  • enable/disable notification on auto-revert (to make it clear why current changes disappeared)
  • enable/disable displaying timer in auto-revert widget. Sometimes it can be useful to see how much time is left till revert. In other cases, you might prefer not to see time left and just focus on making the smallest change possible.

This is not part of the workflow, but you can pause the timer by clicking on auto-revert widget in IDE toolbar.

TCR mode (test && commit || revert)

  • You're not allowed to commit without running a test.
  • If the test fails, current change list is reverted.
  • If the test passed, changes are committed.

This is the most recent constraint so there isn't a lot of experience using it. However, it's much more useful and enjoyable than it might seem initially.

You can find settings in Preferences -> Other Settings -> Limited WIP, where you can:

  • enable/disable component (disabled by default)
  • choose action on passed test, it can be
    • commit
    • amend commit (will open commit dialog if the last commit has been pushed or different set of tests has been run compared to last execution)
    • commit and push (if "push" is supported by VCS)
    • open commit dialog
  • choose commit message source, it can be
    • last commit
    • current changelist name
  • enable/disable notification on revert (to make it clear why current changes disappeared)
  • enable/disable revert of test code (aka relaxed TCR)
  • exclude files from revert in case some tests are not marked as test source root in IDE

I heard about the idea from Kent Beck mentioning Limbo and his "test && commit || revert" blog post in particular. Originally, the idea comes from Oddmund Strømme, Lars Barlindhaug and Ole Tjensvoll Johannessen.

Screenshots

settings screenshot


change limit exceeded notification


commit cancelled notification


Videos

History

The original version of the plugin called "Auto-revert" was conceived at LSCC meetup in 2012 after having a chat with Samir Talwar (it's easy to implement a basic version of auto-revert in bash but there are problems like resetting the timer after each commit and that IntelliJ will be asking on each revert from terminal if you really want to load changes from file system).

Some time later (in 2015) after using auto-revert for a while on large legacy code bases, I found that it can be too harsh sometimes, especially when you're in exploration mode. To solve the problem watchdog component was created which doesn't revert but just notifies if there are too many changes.

At FFS tech conf 2018 Kent Beck mentioned Limbo and test && commit || revert which looked like a great fit for the plugin so I had to implement it.

I hope there will be more components in the future. If you have an idea, feel free to create github issue or tweet it to me.

More Repositories

1

live-plugin

IntelliJ plugin for writing IntelliJ plugins at runtime ⚡️
Kotlin
839
star
2

kotlin-99

Ninety-Nine Problems in Kotlin
Kotlin
650
star
3

tab-shifter

Plugin for IntelliJ IDEA to move and split editor tabs
Kotlin
169
star
4

pomodoro-tm

Pomodoro timer for IntelliJ 🍅⏲
Kotlin
136
star
5

code-history-mining

IntelliJ plugin for analysis and visualisation of project code history
Groovy
121
star
6

scratch

Scratch is IntelliJ IDEs plugin to quickly open temporary text editor
Kotlin
83
star
7

friday-mario

IntelliJ plugin to have fun 🎮🔊
Kotlin
76
star
8

activity-tracker

Plugin for IntelliJ IDEs to track and record user activity
Kotlin
67
star
9

kotlin-native-snake

Slides and source code for the "Live Coding Kotlin/Native Snake" talk
Kotlin
52
star
10

kotlin-puzzlers

Kotlin
36
star
11

ijkl-shortcuts-plugin

IJKL navigation shortcuts plugin for JetBrains IDEs 🙌 ⌨️
Kotlin
27
star
12

slides-presenter

Plugin to show slides and code examples directly from IntelliJ IDEs
Kotlin
21
star
13

rosettacode-kotlin

Repository with source code from http://rosettacode.org/wiki/Category:Kotlin
Kotlin
21
star
14

quick-fix

Plugin for JetBrains IDEs to apply "quick fix" from the most relevant intention or inspection 💡
Kotlin
19
star
15

coroutines-explained

Slides and code for the "Coroutines explained" talk at ACCU, SoCraTes UK and CodeMesh 2018
Kotlin
18
star
16

tictactoe4k

Source code and slides for the tictactoe4k talk
Kotlin
12
star
17

gilded-rose

This is the source code and slides for the Gilded Rose Refactoring Kata talk
Kotlin
10
star
18

easy-way-to-create-ij-plugins

Kotlin
8
star
19

lsystem-js

Interactive demo of L-Systems using webgl, see http://dkandalov.github.io/lsystem/
JavaScript
8
star
20

programming-kotlin-with-nothing

Reimplementing lambda calculus in Kotlin for fun and profit.
Kotlin
6
star
21

parser-combinator-koans

Koans to build parser combinator in Kotlin from scratch
Kotlin
6
star
22

katas

🙈🙈🙈
Roff
5
star
23

kotlin-failed-line-inspection

Kotlin
5
star
24

vcs-reader

Minimal Java library for reading VCS commits (git, hg, svn)
Java
5
star
25

limited-wip-for-devs

Kotlin
5
star
26

intellij-wordcloud

JavaScript
4
star
27

project-treemap

Project treemap micro-plugin for IntelliJ (using d3.js for visualisation)
JavaScript
4
star
28

neo-psi

Groovy
4
star
29

promotion-service-kata

Promotion service kata
C
4
star
30

groovy-beans

Groovy
3
star
31

hello-webgl

JavaScript
3
star
32

definilizer

Java ClassLoader which removes finals at runtime
Java
3
star
33

gilded-rose-service

Code kata and source code for the Refactoring Spring to Kotlin talk
Kotlin
2
star
34

statemachine

A Ruby Library, Gem, and Rails Plugin
Ruby
2
star
35

datsok

Minimal test assertions for Kotlin
Kotlin
2
star
36

error-handling-in-kotlin

Kotlin
2
star
37

code-history-mining-cli

Command line interface for mining code history
2
star
38

Beautiful-code-best-practice-enterprise-patterns

2
star
39

htmlexport

Java
2
star
40

ijkl-keymaps

2
star
41

refactorings

Groovy
2
star
42

nonstdlib

Kotlin
2
star
43

connect-four

Kotlin
2
star
44

opengl_redbook

C
2
star
45

graalvm-snake

Kotlin
2
star
46

flare_visualization

JavaScript
1
star
47

scala-native-snake

Scala
1
star
48

spa-http4k

Kotlin
1
star
49

MarkdownParse

Kotlin
1
star
50

game-of-life-3d

JavaScript
1
star
51

tags

Simple tag manage library
1
star
52

Parser_Combinator_Koans

Kotlin
1
star
53

c-99-problems

🤖🤖🤖
C++
1
star
54

history-slider-plugin

Groovy
1
star
55

understanding-computation

Ruby
1
star
56

dkandalov.github.io

JavaScript
1
star
57

colorizer

Groovy
1
star
58

groovy-beans-user

Groovy
1
star
59

d3-components

JavaScript
1
star
60

rust-snake

Minimal ncurses snake game in rust
Rust
1
star
61

MPS-baseLanguage-examples

MPS baseLanguage examples
1
star
62

man-page-viewer

Man page viewer plugin 📓🤓
Kotlin
1
star
63

squasher

Source code for the squasher coroutine blog post
Assembly
1
star
64

go-snake

Go
1
star
65

dependencies-graph

Groovy
1
star