Skip to content

infinite formatting loop #4

@IgorMinar

Description

@IgorMinar

given code like this:

class DiffResult {
  toString() {
    return `${pad(this.name, 40)}, ` + `duration: ${pad(this.endTime - this.startTime, 5)}ms, ` + `${pad(this.changedPaths.length + this.removedPaths.length, 5)} changes detected ` +
           `(files: ${pad(this.filesChecked, 5)}, directories: ${pad(this.directoriesChecked, 4)})`;
  }

  log(verbose) {
    let prefixedPaths =
        this.changedPaths.map((p) => `* ${p}`).concat(this.removedPaths.map((p) => `- ${p}`));
    console.log(`Tree diff: ${this}` + ((verbose && prefixedPaths.length) ? ` [\n  ${prefixedPaths.join('\n  ')}\n]` :
                                                                             ''));
  }
}

and running: clang-format -i -style='file' /path/to/test.ts

clang-format reformats the file each execution. this causes our CI to fail even after I reformat the file with clang-format.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions