QuiiBz / sherif

Opinionated, zero-config linter for JavaScript monorepos
MIT License
915 stars 14 forks source link

Alternative Usage/Installation method which does not require a node env #67

Closed thomasfr closed 1 week ago

thomasfr commented 5 months ago

In CI/CD environments it would be handy to have an alternative installation method which does not require to have a running node and npm, pnpm, yarn, etc. setup in place. This would greatly reduce CI/CD setup time.

For instance for biome we can do:

jobs:
  quality:
    name: Quality Checks
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: biomejs/setup-biome@v2
      - run: biome ci . --reporter=github

and this finished usually within 5-7 seconds, whereas the setup of node and a package manager alone takes often times between 15-20 seconds. Its not much difference, but since sherif is a binary anyways, it would be an easy win.

AlemTuzlak commented 5 months ago

This would be an amazing thing to have!

AlemTuzlak commented 5 months ago

https://github.com/biomejs/setup-biome/blob/main/src/setup.ts#L41 Here is the biome source code for this, I think this would just be adapted to sherif for it to work

QuiiBz commented 5 months ago

That's a good idea! Will take a look this weekend.

QuiiBz commented 3 months ago

sherif@0.11.0 was just released and now contains the binaries in the GitHub release, so we should be able to do something similar as https://github.com/biomejs/setup-biome

QuiiBz commented 1 week ago

Tested here and seems to work as expected now! The README has been updated to display a minimal example:

name: Sherif
on:
  pull_request:
jobs:
  check:
    name: Run Sherif
    runs-on: ubuntu-22.04
    steps:
      - uses: actions/checkout@v4
      - uses: QuiiBz/sherif@v1
        # Optionally, you can specify a version and arguments to run Sherif with:
        # with:
          # version: 'v1.0.1'
          # args: '--ignore-rule root-package-manager-field'