Skip to content

Adding a --check flag for ci #243

Open
@adamgen

Description

@adamgen

Background

Barrelsby should be used solely while developing, thus compiled barrels should be present while creating PRs.

Proposal

To validate this process, add a --check flag that will not output to the filesystem. Instead, it will compare the desired outputs with the current file system and exit with a non-zero code if there is such a difference. Desirable with some details about which files weren't added during the development phase.

Activity

adamgen

adamgen commented on Mar 13, 2022

@adamgen
Author

As a walkaround, I'm running this in my CI to check if there are changed files after running barrelsby.

barrelsby && git diff --exit-code
github-actions

github-actions commented on Jun 12, 2022

@github-actions

No activity has been seen recently, marking as stale. If this is a mistake please reach out to a collaborator

adamgen

adamgen commented on Jul 3, 2022

@adamgen
Author

Inspired by the integration-tests script I think that a simple implementation for it would be to:

  1. Make a simple run with modified index names. Let's say .barrelsby-index.check.ts.
  2. Compare these new .barrelsby-index.check.ts with the ordinary index.ts while ignoring whitespaces.
  3. Prompt the user if the check passed successfully or not.
  4. Delete the .barrelsby-index.check.ts files.

@BitForger, @bencoveney does this sound like a bad idea?

BitForger

BitForger commented on Aug 7, 2022

@BitForger
Collaborator

Sorry, as you can tell we've both been pretty busy with the personal lives.

My idea for implementation would probably be to walk through and do everything up until the point of creating the file and just compare the contents of the existing file with the string we created in memory. If it matches we exit 0 and if not we exit 1 with the differences if that isn't too hard to do.

github-actions

github-actions commented on Dec 5, 2022

@github-actions

No activity has been seen recently, marking as stale. If this is a mistake please reach out to a collaborator

github-actions

github-actions commented on Apr 13, 2023

@github-actions

No activity has been seen recently, marking as stale. If this is a mistake please reach out to a collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    FeatureAdds a new feature

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @BitForger@adamgen

        Issue actions

          Adding a --check flag for ci · Issue #243 · bencoveney/barrelsby