Skip to content

Commit ef9f647

Browse files
committed
Check line break styles
Running `dos2unix` and check if there are any changes to make sure that we don't include any files with DOS-style line breaks.
1 parent 9aa3d36 commit ef9f647

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

.github/workflows/ci_tests.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,21 @@ jobs:
3131
python-version: 3.8
3232

3333
- name: Install packages
34-
run: pip install black blackdoc flake8 pylint
34+
run: |
35+
pip install black blackdoc flake8 pylint
36+
sudo apt-get install dos2unix
3537
3638
- name: Formatting check (black and flake8)
3739
run: make check
3840

3941
- name: Linting (pylint)
4042
run: make lint
4143

44+
- name: Line breaks check (dos2unix)
45+
run: |
46+
dos2unix **/*.py **/*.md
47+
if [[ $(git ls-files -m) ]]; then git --no-pager diff HEAD; exit 1; fi
48+
4249
test:
4350
name: ${{ matrix.os }} - Python ${{ matrix.python-version }}
4451
runs-on: ${{ matrix.os }}

.github/workflows/format-command.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,15 @@ jobs:
2525

2626
# Install formatting tools
2727
- name: Install formatting tools
28-
run: pip install black blackdoc flake8
28+
run: |
29+
pip install black blackdoc flake8
30+
sudo apt-get install dos2unix
2931
3032
# Run "make format" and commit the change to the PR branch
3133
- name: Commit to the PR branch if any changes
3234
run: |
3335
make format
36+
dos2unix **/*.py **/*.md
3437
if [[ $(git ls-files -m) ]]; then
3538
git config --global user.name 'actions-bot'
3639
git config --global user.email '58130806+actions-bot@users.noreply.github.com'

0 commit comments

Comments
 (0)