Skip to content

Skip CI on comment/whitespace only changes #16463

@OwnageIsMagic

Description

@OwnageIsMagic
          Thanks! I wonder if we somehow can utilise fantomas (or its libraries) to check whether if the changes are in docs, and don't run full CI suite? We do it already for markdown changes.

Originally posted by @vzarytovskii in #16453 (comment)

I created fsx script that will tokenize changed files and check is changed lines contain only comments or whitespace.
https://gist.github.com/OwnageIsMagic/541c8abbd435cf82b1aacc250e24f54c
dotnet fsi check.fsx -- @^ ; echo $?

upd: there is a lot of false negatives from patches like

@@ -209,0 +210 @@
+(*
@@ -223,0 +225 @@
+*)

Patch only changed comment line, but it affects all lines after it.
Another approach I would try is to zip two token streams and check if they contain same sequence of comment/non-comment tokens.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    New

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions