Skip to content

Commit

Permalink
Check line break styles
Browse files Browse the repository at this point in the history
Running `dos2unix` and check if there are any changes to make sure that
we don't include any files with DOS-style line breaks.
  • Loading branch information
seisman committed Dec 15, 2020
1 parent 9aa3d36 commit ef9f647
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/ci_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,21 @@ jobs:
python-version: 3.8

- name: Install packages
run: pip install black blackdoc flake8 pylint
run: |
pip install black blackdoc flake8 pylint
sudo apt-get install dos2unix
- name: Formatting check (black and flake8)
run: make check

- name: Linting (pylint)
run: make lint

- name: Line breaks check (dos2unix)
run: |
dos2unix **/*.py **/*.md
if [[ $(git ls-files -m) ]]; then git --no-pager diff HEAD; exit 1; fi
test:
name: ${{ matrix.os }} - Python ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/format-command.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,15 @@ jobs:

# Install formatting tools
- name: Install formatting tools
run: pip install black blackdoc flake8
run: |
pip install black blackdoc flake8
sudo apt-get install dos2unix
# Run "make format" and commit the change to the PR branch
- name: Commit to the PR branch if any changes
run: |
make format
dos2unix **/*.py **/*.md
if [[ $(git ls-files -m) ]]; then
git config --global user.name 'actions-bot'
git config --global user.email '58130806+actions-bot@users.noreply.github.com'
Expand Down

0 comments on commit ef9f647

Please sign in to comment.