Skip to content

ci: add optional pre-commit config#78

Open
DrKJeff16 wants to merge 1 commit intodchinmay2:mainfrom
DrKJeff16:patch/pre-commit
Open

ci: add optional pre-commit config#78
DrKJeff16 wants to merge 1 commit intodchinmay2:mainfrom
DrKJeff16:patch/pre-commit

Conversation

@DrKJeff16
Copy link
Contributor

Description

pre-commit is useful for users that decide to use it
to get hooks to run on commit.

I've added a very useful hook for running StyLua in case formatting wasn't made.

@dchinmay2
Copy link
Owner

I'm trying to see if I can connect github actions to sourechut builds, so that there's only one place where CI is run

@DrKJeff16
Copy link
Contributor Author

DrKJeff16 commented Aug 7, 2025

I'm trying to see if I can connect github actions to sourechut builds, so that there's only one place where CI is run

I have a useful StyLua Workflow that I use frequently (.github/workflows/stylua.yml):

# This is a basic workflow to help you get started with Actions

name: Stylua

# Controls when the workflow will run
on:
- push
- pull_request

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
  # This workflow contains a single job called "build"
  check:
    # The type of runner that the job will run on
    runs-on: ubuntu-latest

    # Steps represent a sequence of tasks that will be executed as part of the job
    steps:
      # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
      - name: Checkout
        uses: actions/checkout@v4
      - name: "Run stylua"
        uses: JohnnyMorganz/stylua-action@v4
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          version: latest # NOTE: we recommend pinning to a specific version in case of formatting changes
          # CLI arguments
          args: --check .

@DrKJeff16
Copy link
Contributor Author

Note that pre-commit is, I believe, mostly for the one who does the commits. I'm not sure it interacts with GitHub Actions (though I'm very new to Actions still)

@DrKJeff16
Copy link
Contributor Author

I'm trying to see if I can connect github actions to sourechut builds, so that there's only one place where CI is run

@p00f
Does #79 help in any way possible?

@DrKJeff16 DrKJeff16 changed the title [CI] Added optional pre-commit hook to run StyLua on commit ci: add optional pre-commit config Nov 3, 2025
Signed-off-by: Guennadi Maximov C <g.maxc.fox@protonmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants