Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,25 @@ 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: |
python -m pip install .

- 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: |
Expand Down
28 changes: 14 additions & 14 deletions .pre-commit-hooks.yaml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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) <mmicu.github00@gmail.com>"

COPY . /app
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
2 changes: 1 addition & 1 deletion run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
11 changes: 7 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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():
Expand All @@ -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,
)
Expand Down Expand Up @@ -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')
Expand Down