Skip to content

Commit

Permalink
Merge pull request #71 from rtts/69-funny-behavior-with-pre-commit-an…
Browse files Browse the repository at this point in the history
…d-windows

Remove `-i` and `-o` command line options
  • Loading branch information
JaapJoris committed Jan 31, 2023
2 parents 295a54c + d837077 commit 898894b
Show file tree
Hide file tree
Showing 9 changed files with 192 additions and 200 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
- 3.8
- 3.9
- '3.10'
- '3.11'

steps:
- uses: actions/checkout@v2
Expand All @@ -33,4 +34,4 @@ jobs:
python -m pip install --upgrade nox
- name: Run tox targets for ${{ matrix.python-version }}
run: nox
run: nox --session tests-${{ matrix.python-version }}
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
repos:
- repo: https://github.com/pycqa/isort
rev: 5.10.1
rev: 5.12.0
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: 22.3.0
rev: 22.12.0
hooks:
- id: black
- repo: https://github.com/pycqa/flake8
rev: 4.0.1
rev: 6.0.0
hooks:
- id: flake8
6 changes: 3 additions & 3 deletions .pre-commit-hooks.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
- id: djhtml
name: DjHTML
entry: djhtml -i
entry: djhtml
types: [html]
language: python
language_version: python3
Expand All @@ -9,7 +9,7 @@

- id: djcss
name: DjCSS
entry: djcss -i
entry: djcss
types_or: [css, scss]
language: python
language_version: python3
Expand All @@ -18,7 +18,7 @@

- id: djjs
name: DjJS
entry: djjs -i
entry: djjs
types: [javascript]
language: python
language_version: python3
Expand Down
29 changes: 9 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,29 +62,18 @@ Install DjHTML with the following command:
## Usage

After installation you can indent templates using the `djhtml`
command. The default is to read from standard in and to write the
indented output to standard out. To modify the source file in-place,
use the `-i` / `--in-place` option and specify a filename:
command:

$ djhtml -i template.html
$ djhtml template.html
reindented template.html
1 template has been reindented.

Normally, the exit status of 0 means everything went well, regardless
of whether any files were changed. If any errors were encountered, the
exit status indicated the number of problematic files. However, when
the option `-c` / `--check` is used, the exit status is the number of
files that would have changed, but no changes are actually made.

All available options are:

- `-h` / `--help`: show overview of available options
- `-i` / `--in-place`: modify files in-place
- `-c` / `--check`: don't modify files; the exit status is the number
of files that would have changed
- `-q` / `--quiet`: don't print any output
- `-t` / `--tabwidth`: set tabwidth (default is 4)
- `-o` / `--output-file`: write output to specified file
An exit status of 0 means that everything went well, regardless of
whether any files were changed. When the option `-c` / `--check` is
used, the exit status is 1 when one or more files would have changed,
but no changes are actually made. The exit status of 123 means that
there was an error while indenting one or more files. All available
options are given by `djthml -h` / `djthml --help`.


## `fmt:off` and `fmt:on`
Expand Down Expand Up @@ -157,7 +146,7 @@ the default tabwidth, you change the `entry` point of these hooks:
hooks:
- id: djhtml
# Use a tabwidth of 2 for HTML files
entry: djhtml -i -t 2
entry: djhtml --tabwith 2
- id: djcss
- id: djjs
```
Expand Down
Loading

0 comments on commit 898894b

Please sign in to comment.