diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 76df8c2..16ce6cb 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -16,12 +16,12 @@ jobs: os: - 'ubuntu-24.04' - 'ubuntu-24.04-arm' - - 'macos-13' # the last intel mac + - 'macos-15-intel' - 'macos-15' # arm64 mac - 'windows-2025' runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 - name: install local package run: | @@ -29,12 +29,12 @@ jobs: - name: test that editorconfig-checker works by letting it output it's version run: | - ec --version + editorconfig-checker --version test-python-versions: runs-on: ubuntu-24.04 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 - name: install flake8 run: | diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml index 9b36e3b..6549e53 100644 --- a/.pre-commit-hooks.yaml +++ b/.pre-commit-hooks.yaml @@ -1,15 +1,15 @@ --- -- id: editorconfig-checker - name: 'Check .editorconfig rules' - description: '`editorconfig-checker` is a tool to check if your files consider your .editorconfig-rules.' - entry: ec - language: python - types: [ text ] - require_serial: true -- id: editorconfig-checker-system - name: 'Check .editorconfig rules' - description: 'Runs system executable of `editorconfig-checker` to lint text files according to `.editorconfig` rules' - language: system - entry: ec - types: [ text ] - require_serial: true +- id: editorconfig-checker + name: "Check .editorconfig rules" + description: "`editorconfig-checker` is a tool to check if your files consider your .editorconfig-rules." + entry: editorconfig-checker + language: python + types: [text] + require_serial: true +- id: editorconfig-checker-system + name: "Check .editorconfig rules" + description: "Runs system executable of `editorconfig-checker` to lint text files according to `.editorconfig` rules" + language: system + entry: editorconfig-checker + types: [text] + require_serial: true diff --git a/Dockerfile b/Dockerfile index d4f8286..b23a1ec 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,7 +8,7 @@ FROM python:$IMAGE AS pybase RUN python -m pip install --upgrade pip # separate the obtaining of the requirements from the actual test, so we can use build caching for the first step -FROM pybase as tester +FROM pybase AS tester LABEL maintainer="Marco M. (mmicu) " COPY . /app diff --git a/Makefile b/Makefile index c297ac5..ac34ad1 100644 --- a/Makefile +++ b/Makefile @@ -27,7 +27,7 @@ publish: clean test .PHONY: quick-test quick-test: coding-style docker build -t ec-quick-test . - docker run ec-quick-test ec -version + docker run ec-quick-test editorconfig-checker -version .PHONY: test test: coding-style diff --git a/README.md b/README.md index 9db5b29..129cc67 100644 --- a/README.md +++ b/README.md @@ -23,10 +23,10 @@ Internally, this package provides a convenient way to download the pre-built `ed ## Usage -After installation, the `ec` binary should be available in your environment (or `ec.exe` on Windows): +After installation, the `editorconfig-checker` binary should be available in your environment (or `editorconfig-checker.exe` on Windows): ``` -ec -version +editorconfig-checker -version ``` ## Usage with the pre-commit git hooks framework @@ -36,26 +36,26 @@ The easiest way to get started is to add this configuration to your `.pre-commit ```yaml repos: -- repo: https://github.com/editorconfig-checker/editorconfig-checker.python - rev: '' # pick a git hash / tag to point to + - repo: https://github.com/editorconfig-checker/editorconfig-checker.python + rev: "" # pick a git hash / tag to point to hooks: - - id: editorconfig-checker - alias: ec + - id: editorconfig-checker + alias: editorconfig-checker ``` The above hook is a python wrapper that automatically downloads and installs [editorconfig-checker](https://editorconfig-checker.github.io/) binary. If you manage your tools in some other way, for example, via [ASDF](https://asdf-vm.com/), you may want to use an alternative pre-commit hook that assumes that -`ec` binary executable is already available on the system path: +`editorconfig-checker` binary executable is already available on the system path: ```yaml repos: -- repo: https://github.com/editorconfig-checker/editorconfig-checker.python - rev: '' # pick a git hash / tag to point to + - repo: https://github.com/editorconfig-checker/editorconfig-checker.python + rev: "" # pick a git hash / tag to point to hooks: - - id: editorconfig-checker-system - alias: ec + - id: editorconfig-checker-system + alias: editorconfig-checker ``` See the [pre-commit docs](https://pre-commit.com/#pre-commit-configyaml---hooks) to check how to customize this configuration. diff --git a/run-tests.sh b/run-tests.sh index 16b382c..39db05b 100755 --- a/run-tests.sh +++ b/run-tests.sh @@ -22,7 +22,7 @@ build_docker_image_and_run() { --build-arg "PACKAGE=$docker_package" \ . - docker run --rm "$docker_image" ec -version + docker run --rm "$docker_image" editorconfig-checker -version } main() { diff --git a/setup.py b/setup.py index e0e0b8e..e387f17 100644 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ During setup, the tarball that contains the executable will be downloaded based on the target machine and its content extracted in the proper output directory. -Once the setup is complete, the `ec` executable should be available on your machine. +Once the setup is complete, the `editorconfig-checker` executable should be available on your machine. """ from distutils.command.build import build as orig_build @@ -34,7 +34,7 @@ WRAPPER_VERSION = '3.11.1' EDITORCONFIG_CHECKER_CORE_VERSION = 'v3.11.1' -EDITORCONFIG_CHECKER_EXE_NAME = 'ec' +EDITORCONFIG_CHECKER_EXE_NAME = 'editorconfig-checker' def get_tarball_url(): @@ -56,12 +56,15 @@ def get_ec_name_by_system(): else: raise ValueError('Cannot determine architecture') + if _system == 'Darwin': + _architecture = 'all' + # The core, from `2.7.0`, introduces the extension in the tarball name # (e.g. `ec-windows-386.exe.tar.gz`, `ec-windows-arm.exe.tar.gz`) # In `3.1.0` the windows extension was then again dropped from the # archive name. - return 'ec-{}-{}'.format( + return 'editorconfig-checker-{}-{}'.format( _system.lower(), _architecture, ) @@ -91,7 +94,7 @@ def extract_tarball(url, data): if '.tar.' in url: with tarfile_open(fileobj=bio) as fp: for info in fp.getmembers(): - if info.isfile() and info.name.startswith('bin/ec-'): + if info.isfile() and info.name.startswith('editorconfig-checker'): return fp.extractfile(info).read() raise AssertionError('unreachable `extract` function')