Skip to content

Commit

Permalink
Introduce new linter and pre-commit (asreview#1640)
Browse files Browse the repository at this point in the history
  • Loading branch information
J535D165 authored Jan 6, 2024
1 parent 6ef67ab commit 9e89c22
Show file tree
Hide file tree
Showing 125 changed files with 2,346 additions and 2,283 deletions.
10 changes: 5 additions & 5 deletions .github/ISSUE_TEMPLATE/bug.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
---
name: "Bug report \U0001F41B"
about: "If something isn't working as expected \U0001F914."
title: ''
title: ""
labels: bug

---

**Describe the bug**
A clear and concise description of what the bug is.
*What happened? And what did you expect to happen?*
_What happened? And what did you expect to happen?_

**To Reproduce**
Steps to reproduce the problem:
Expand All @@ -17,8 +16,9 @@ Steps to reproduce the problem:
If applicable, add screenshots to help explain your problem.

**Version information**
- OS: [e.g. Windows]
- ASReview version [e.g. 0.6.2]

- OS: [e.g. Windows]
- ASReview version [e.g. 0.6.2]

**Additional context**
Add any other context about the problem here.
5 changes: 2 additions & 3 deletions .github/ISSUE_TEMPLATE/feature-request.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
name: "\U0001F680 Feature request"
about: "I have a suggestion (and may want to implement it \U0001F642)!"
title: ''
labels: 'i: enhancement'
title: ""
labels: "i: enhancement"
assignees: J535D165

---

## Feature Request
Expand Down
14 changes: 7 additions & 7 deletions .github/ISSUE_TEMPLATE/user-interface.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
---
name: User interface
about: Issues related to the User Interface of ASReview
title: ''
title: ""
labels: front-end
assignees: J535D165, mmeijer23

---

**Describe the bug**
A clear and concise description of what the bug with the front-end is.
*What happened? And what did you expect to happen?*
_What happened? And what did you expect to happen?_

**To Reproduce**
Steps to reproduce the behavior:

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error


**Screenshots**
If applicable, add screenshots to help explain your problem.

**Version information**
- OS: [e.g. Windows]
- Browser [e.g. chrome, safari]
- ASReview version [e.g. 0.6.2]

- OS: [e.g. Windows]
- Browser [e.g. chrome, safari]
- ASReview version [e.g. 0.6.2]

**Additional context**
Add any other context about the problem here.
7 changes: 2 additions & 5 deletions .github/PULL_REQUEST_TEMPLATE/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,9 @@ Changes proposed in this pull request:

-
-
-

*Add screenshots for proposed visual changes*

- _Add screenshots for proposed visual changes_

**Checklist**
**Checklist**

- [ ] Unit tests are added for new features and bug fixes
- [ ] Documentation is added for new features
Expand Down
84 changes: 42 additions & 42 deletions .github/workflows/ci-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,56 +5,56 @@ jobs:
name: lint-python
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install flake8
run: |
pip install flake8 isort flake8-isort
- name: Lint python with flake8
run: |
flake8 . --max-complexity=10 --statistics
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install ruff
run: |
pip install .[dev]
- name: Lint Python
run: |
ruff .
test-minimal-deps:
name: test-minimal-deps
runs-on: ubuntu-latest
strategy:
matrix:
python: ["3.8", "3.12"]
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Install packages
run: |
pip install pytest
pip install --no-cache-dir .
- name: Run test suite
run: |
pytest tests/
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Install packages
run: |
pip install pytest
pip install --no-cache-dir .
- name: Run test suite
run: |
pytest tests/
test-full-deps:
name: test-full-deps
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install packages
run: |
pip install pytest
pip install --upgrade setuptools>=41.0.0
pip install --no-cache-dir .[sbert]
pip install --no-cache-dir .[doc2vec]
pip install --no-cache-dir .[tensorflow]
pip install --no-cache-dir .[dev]
pip install --no-cache-dir .[test]
pip install --no-cache-dir .
- name: Run test suite
run: |
pytest tests/
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install packages
run: |
pip install pytest
pip install --upgrade setuptools>=41.0.0
pip install --no-cache-dir .[sbert]
pip install --no-cache-dir .[doc2vec]
pip install --no-cache-dir .[tensorflow]
pip install --no-cache-dir .[dev]
pip install --no-cache-dir .[test]
pip install --no-cache-dir .
- name: Run test suite
run: |
pytest tests/
8 changes: 4 additions & 4 deletions .github/workflows/ci-frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ jobs:
python-version: "3.10"
- uses: actions/setup-node@v3
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: 'asreview/webapp/package-lock.json'
- name : Get Tags
node-version: "20"
cache: "npm"
cache-dependency-path: "asreview/webapp/package-lock.json"
- name: Get Tags
run: |
git fetch --prune --unshallow --tags
git tag
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Docker deployment
on:
push:
tags:
- 'v*'
- "v*"

jobs:
docker:
Expand Down
30 changes: 15 additions & 15 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ jobs:
docs:
runs-on: macos-latest
steps:
- name: Clone repo
uses: actions/checkout@v3
- name: Install pandoc
run: |
brew install pandoc
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install ASReview with docs dependencies
run: |
python -m pip install .[docs]
- name: Build HTML
run: |
python -m sphinx -W --keep-going --color docs/source/ build/html/
- name: Clone repo
uses: actions/checkout@v3
- name: Install pandoc
run: |
brew install pandoc
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install ASReview with docs dependencies
run: |
python -m pip install .[docs]
- name: Build HTML
run: |
python -m sphinx -W --keep-going --color docs/source/ build/html/
108 changes: 54 additions & 54 deletions .github/workflows/extensions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,65 +5,65 @@ jobs:
name: test-asreview-datatools
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install packages
run: |
pip install pytest
pip install --no-cache-dir .
- name: Install extension
run: |
git clone https://github.com/asreview/asreview-datatools
cd asreview-datatools
latestTag=$(git describe --tags `git rev-list --tags --max-count=1`)
git checkout $latestTag
pip install .
- name: Run test on asreview-datatools
run: |
pytest asreview-datatools/tests/
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install packages
run: |
pip install pytest
pip install --no-cache-dir .
- name: Install extension
run: |
git clone https://github.com/asreview/asreview-datatools
cd asreview-datatools
latestTag=$(git describe --tags `git rev-list --tags --max-count=1`)
git checkout $latestTag
pip install .
- name: Run test on asreview-datatools
run: |
pytest asreview-datatools/tests/
test-asreview-insights:
name: test-asreview-insights
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install packages
run: |
pip install pytest
pip install --no-cache-dir .
- name: Install extension
run: |
git clone https://github.com/asreview/asreview-insights
cd asreview-insights
latestTag=$(git describe --tags `git rev-list --tags --max-count=1`)
git checkout $latestTag
pip install .
- name: Run test on asreview-insights
run: |
pytest asreview-insights/tests/
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install packages
run: |
pip install pytest
pip install --no-cache-dir .
- name: Install extension
run: |
git clone https://github.com/asreview/asreview-insights
cd asreview-insights
latestTag=$(git describe --tags `git rev-list --tags --max-count=1`)
git checkout $latestTag
pip install .
- name: Run test on asreview-insights
run: |
pytest asreview-insights/tests/
test-asreview-wordcloud:
name: test-asreview-wordcloud
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install packages
run: |
pip install pytest
pip install --no-cache-dir .
- name: Install extension
run: |
git clone https://github.com/asreview/asreview-wordcloud
cd asreview-wordcloud
latestTag=$(git describe --tags `git rev-list --tags --max-count=1`)
git checkout $latestTag
pip install .
- name: Run test on asreview-wordcloud
run: |
pytest asreview-wordcloud/tests/
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install packages
run: |
pip install pytest
pip install --no-cache-dir .
- name: Install extension
run: |
git clone https://github.com/asreview/asreview-wordcloud
cd asreview-wordcloud
latestTag=$(git describe --tags `git rev-list --tags --max-count=1`)
git checkout $latestTag
pip install .
- name: Run test on asreview-wordcloud
run: |
pytest asreview-wordcloud/tests/
Loading

0 comments on commit 9e89c22

Please sign in to comment.