Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 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
10 changes: 9 additions & 1 deletion .github/workflows/ci_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,22 @@ 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: Ensure files use UNIX line breaks and have 644 permission
run: |
find . -type f -not -path '*/\.git/*' -exec grep -Iq . {} \; -exec dos2unix --quiet {} \;
find . -type f -not -path '*/\.git/*' -exec grep -Iq . {} \; -exec chmod 644 {} \;
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
6 changes: 5 additions & 1 deletion .github/workflows/format-command.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,16 @@ 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
find . -type f -not -path '*/\.git/*' -exec grep -Iq . {} \; -exec dos2unix {} \;
find . -type f -not -path '*/\.git/*' -exec grep -Iq . {} \; -exec chmod 644 {} \;
if [[ $(git ls-files -m) ]]; then
git config --global user.name 'actions-bot'
git config --global user.email '[email protected]'
Expand Down
3 changes: 3 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,9 @@ Before committing, run it to automatically format your code:
make format
```

We also consistently use UNIX-style line endings (`\n`) and file permission
644 (`-rw-r--r--`) throughout the whole project.

Don't worry if you forget to do it. Our continuous integration systems will
warn us and you can make a new commit with the formatted code.
Even better, you can just write `/format` in the first line of any comment in a
Expand Down