Skip to content

Formatting is unstable (not idempotent) #686

@adrian-gierakowski

Description

@adrian-gierakowski

Describe the bug

Running dprint fmt on the on some code twice, leads to different output each time.

Input Code

const createTestData = () =>
  function*() {
    const startingFrom = yield* Effect.map(DateTime.now, now =>
      DateTime.startOf(now, 'day'))

    return HashSet.make(DateTime.toEpochMillis(startingFrom))
  }

Expected Output

const createTestData = () =>
  function*() {
    const startingFrom = yield* Effect.map(DateTime.now, now =>
      DateTime.startOf(now, 'day'))

    return HashSet.make(DateTime.toEpochMillis(startingFrom))
  }

Actual Output

first time:

const createTestData = () =>
  function*() {
    const startingFrom = yield* Effect.map(DateTime.now, now =>
      DateTime.startOf(now, 'day'))

    return HashSet
      .make(DateTime.toEpochMillis(startingFrom))
  }

second time:

const createTestData = () =>
  function*() {
    const startingFrom = yield* Effect.map(DateTime.now, now =>
      DateTime.startOf(now, 'day'))

    return HashSet
      .make(DateTime
        .toEpochMillis(startingFrom))
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions