Skip to content

Conversation

StrikerRUS
Copy link
Collaborator

@StrikerRUS StrikerRUS commented Oct 13, 2025

Support: node hooks work without any system-level dependencies. It has been tested on linux, windows, and macOS and may work under cygwin.

https://pre-commit.com/#node

I decided to check that and made the following actions config:

name: pre-commit

on:
  pull_request:
  push:
    branches: ci/test-pre-commit

jobs:
  pre-commit:
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        include:
          - os: ubuntu-latest
          - os: macos-latest
          - os: windows-latest
    steps:
      - name: Prepare git
        if: startsWith(matrix.os, 'windows')
        run: git config --global core.autocrlf false
      - uses: actions/checkout@v3
      - uses: actions/setup-python@v3
      - uses: pre-commit/[email protected]

Works fine on Windows, macOS and Ubuntu: https://github.com/microsoft/LightGBM/actions/runs/18497387840

# pixi environments
.pixi

# mypy
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"enabled": true,
"useEditorconfig": true
"useEditorconfig": true,
"lineWidth": 120
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That property has been deprecated and isn't part of the editor config anymore
editorconfig/editorconfig#387

biomejs/biome#7733 (comment)

@@ -1,21 +1,21 @@
{
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New config is a result of the following v2 release: https://biomejs.dev/guides/upgrade-to-biome-v2/

{
"files": {
"ignore": [".mypy_cache/", ".pixi/"]
"root": false,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it's needed because pre-commit creates another one root config on the fly.

biome ci.................................................................Failed
- hook id: biome-ci
- exit code: 1

 configuration ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

  ✖ Found a nested root configuration, but there's already a root configuration.
  
  ℹ The other configuration was found in .
  
  ℹ Use the migration command from the root of the project to update the configuration.
  
  $ biome migrate --write
  

configuration ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

  ✖ Biome exited because the configuration resulted in errors. Please fix them.

@StrikerRUS StrikerRUS marked this pull request as ready for review October 13, 2025 21:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant