default_language_version:
    python: python3.11

repos:
  - repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v4.6.0
    hooks:
      - id: check-case-conflict # checks for files that would conflict in case-insensitive filesystems.
      - id: check-executables-have-shebangs # ensures that (non-binary) executables have a shebang.
      - id: check-json # checks json files for parseable syntax.
      - id: check-shebang-scripts-are-executable # ensures that (non-binary) files with a shebang are executable.
      - id: check-merge-conflict # checks for files that contain merge conflict strings.
      - id: detect-private-key # detects the presence of private keys.
        files: "aba_cli_scrapper/.*\\.py"
      - id: trailing-whitespace # trims trailing whitespace.


  - repo: https://github.com/astral-sh/ruff-pre-commit
    # Ruff version.
    rev: v0.6.2
    hooks:
      # Run the linter.
      - id: ruff
        args: [ --fix ]
        files: "aba_cli_scrapper/.*\\.py"
        exclude: "doc/.*\\.py"
        args: [ --config, pyproject.toml ]
        verbose: true # show the result of the linter in the terminal.
        always_run: true

      # Run the formatter.
      - id: ruff-format
        args: [ --config, pyproject.toml ]
        files: "aba_cli_scrapper/.*\\.py"
        exclude: "doc/.*\\.py"
        verbose: true # show the result of the linter in the terminal.
        always_run: true

  # - repo: https://github.com/pre-commit/mirrors-prettier
  #   rev: v2.5.1
  #   hooks:
  #     - id: prettier
  #       files: \.md