File tree Expand file tree Collapse file tree 4 files changed +13
-6
lines changed Expand file tree Collapse file tree 4 files changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import mill.api.internal
1010 */
1111@ internal
1212private [mill] trait Watchable {
13+
1314 /** @return the hashcode of a watched value. */
1415 def poll (): Long
1516
Original file line number Diff line number Diff line change @@ -97,7 +97,8 @@ case class MillCliConfig(
9797 watch : Flag = Flag (),
9898 @ arg(
9999 name = " watch-via-fs-notify" ,
100- doc = " Use filesystem based file watching instead of polling based one (experimental, defaults to false)." ,
100+ doc =
101+ " Use filesystem based file watching instead of polling based one (experimental, defaults to false)."
101102 )
102103 watchViaFsNotify : Boolean = false ,
103104 @ arg(
Original file line number Diff line number Diff line change @@ -232,7 +232,9 @@ object MillMain {
232232 val (isSuccess, evalStateOpt) = Watching .watchLoop(
233233 ringBell = config.ringBell.value,
234234 watch = Option .when(config.watch.value)(Watching .WatchArgs (
235- setIdle, colors, useNotify = config.watchViaFsNotify
235+ setIdle,
236+ colors,
237+ useNotify = config.watchViaFsNotify
236238 )),
237239 streams = streams,
238240 evaluate = (enterKeyPressed : Boolean , prevState : Option [RunnerState ]) => {
Original file line number Diff line number Diff line change @@ -147,7 +147,9 @@ object Watching {
147147
148148 val osLibWatchPaths = watchedPathsSet.iterator.map(p => p / " .." ).toSet
149149 if (enableDebugLog) DebugLog .println(
150- colors.info(s " [watch:watched-paths] ${osLibWatchPaths.toSeq.sorted.mkString(" \n " )}" ).toString
150+ colors.info(
151+ s " [watch:watched-paths] ${osLibWatchPaths.toSeq.sorted.mkString(" \n " )}"
152+ ).toString
151153 )
152154
153155 Using .resource(os.watch.watch(
@@ -168,7 +170,9 @@ object Watching {
168170 // Make sure that the changed paths are actually the ones in our watch list and not some adjacent files in the
169171 // same folder
170172 val hasWatchedPath =
171- changedPaths.exists(p => watchedPathsSet.exists(watchedPath => p.startsWith(watchedPath)))
173+ changedPaths.exists(p =>
174+ watchedPathsSet.exists(watchedPath => p.startsWith(watchedPath))
175+ )
172176 if (enableDebugLog) DebugLog .println(colors.info(
173177 s " [watch:changed-paths] (hasWatchedPath= $hasWatchedPath) ${changedPaths.mkString(" \n " )}"
174178 ).toString)
@@ -184,8 +188,7 @@ object Watching {
184188 )) { _ =>
185189 doWatch(notifiablesChanged = () => pathChangesDetected)
186190 }
187- }
188- else {
191+ } else {
189192 doWatch(notifiablesChanged = () => watchedPathsSeq.exists(p => ! p.validate()))
190193 }
191194 }
You can’t perform that action at this time.
0 commit comments