Skip to content

Commit 4ed02b2

Browse files
authored
Merge pull request #132 from MightyCreak/remove-lasting-lint-errors
Remove lasting lint errors
2 parents 6960363 + 6685b89 commit 4ed02b2

File tree

15 files changed

+370
-223
lines changed

15 files changed

+370
-223
lines changed

.flake8

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,3 @@
22
builtins = _
33
max-line-length = 100
44
show-source = true
5-
6-
# Temporary
7-
exclude = src/diffuse/main.py
Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,34 +18,38 @@ jobs:
1818
steps:
1919
- uses: actions/checkout@v2
2020
- uses: actions/setup-python@v2
21-
- run: sudo apt install libgirepository1.0-dev
22-
- run: pip install -r requirements.txt
23-
24-
- name: Flake8
25-
run: flake8 src/ po/
26-
27-
- name: MyPy
28-
run: mypy src/ po/
29-
30-
meson-build-test:
31-
runs-on: ubuntu-latest
32-
steps:
33-
- uses: actions/checkout@v2
34-
- uses: actions/setup-python@v2
3521

3622
- name: Install dependencies
37-
run: sudo apt-get -y install appstream appstream-util desktop-file-utils gettext
23+
run: |
24+
sudo apt-get -y install libgirepository1.0-dev appstream appstream-util desktop-file-utils gettext
25+
pip install -r requirements.dev.txt
3826
3927
- name: Meson build
4028
uses: BSFishy/[email protected]
4129
with:
4230
action: build
31+
setup-options: --prefix=/tmp/diffuse
4332

4433
- name: Meson test
4534
uses: BSFishy/[email protected]
4635
with:
4736
action: test
4837

38+
- name: Meson install
39+
uses: BSFishy/[email protected]
40+
with:
41+
action: install
42+
43+
- name: Flake8
44+
run: |
45+
flake8 /tmp/diffuse/
46+
flake8 po/
47+
48+
- name: MyPy
49+
run: |
50+
mypy /tmp/diffuse/
51+
mypy po/
52+
4953
flatpak-build-test:
5054
runs-on: ubuntu-latest
5155
container:

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1616
io.github.mightycreak.Diffuse.appdata.xml.in
1717
- Leaner README.md
1818
- Moved the documentation to docs/
19+
- In the CI, call the linters on the installed directory
20+
21+
### Fixed
22+
- Removed the lasting lint errors (i.e. in main.py)
1923

2024
## 0.7.3 - 2021-11-22
2125

2226
### Added
2327
- Added linters (flake8 and mypy) and fixed some errors
2428
- Added lint jobs for both in the CI
2529
- Added a flatpak job in the CI
30+
- Created a requirements.dev.txt just for the developers
2631

2732
### Changed
2833
- main.py slimmed down by about 5000 lines

data/diffuserc.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
#
33
# Copyright (C) 2006-2009 Derrick Moser <[email protected]>
44

5-
import @pkgdatadir@/syntax/*.syntax
5+
import @PKGDATADIR@/syntax/*.syntax

data/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ endif
3333

3434
# Diffuse config file
3535
conf = configuration_data()
36-
conf.set('pkgdatadir', pkgdatadir)
36+
conf.set('PKGDATADIR', pkgdatadir)
3737

3838
configure_file(
3939
input: 'diffuserc.in',

docs/developers.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,17 @@
22

33
## Requirements
44

5-
Diffuse is implemented in Python and should run on any platform with Python and
6-
PyGObject.
5+
To install the requirements just to execute the binary, run:
76

8-
* Python >= 3.4
9-
* PyGObject >= 3.18
7+
```sh
8+
pip install -r requirements.txt
9+
```
10+
11+
For developer tools, run this one instead (it includes requirements.txt):
12+
13+
```sh
14+
pip install -r requirements.dev.txt
15+
```
1016

1117
## Setup on Linux
1218

requirements.dev.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
-r requirements.txt
2+
flake8 ~= 3.8
3+
flake8-noqa ~= 1.2
4+
mypy ~= 0.910

requirements.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
flake8 ~= 3.8
2-
mypy ~= 0.910
31
PyGObject ~= 3.40

src/diffuse/constants.py.in

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@
1919

2020
APP_NAME = 'Diffuse'
2121
VERSION = '@VERSION@'
22-
COPYRIGHT = '''{copyright} © 2006-2019 Derrick Moser
23-
{copyright} © 2015-2021 Romain Failliot'''.format(copyright=_("Copyright"))
22+
COPYRIGHT = '''{copyright} © 2006-2019 Derrick Moser
23+
{copyright} © 2015-2021 Romain Failliot'''.format(copyright=_("Copyright")) # type: ignore
2424
WEBSITE = 'https://mightycreak.github.io/diffuse/'
2525

26-
sysconfigdir = '@sysconfigdir@'
26+
SYSCONFIGDIR = '@SYSCONFIGDIR@'
2727

28-
use_flatpak = @use_flatpak@
29-
log_print_output = @log_print_output@
30-
log_print_stack = @log_print_stack@
28+
LOG_PRINT_OUTPUT = @LOG_PRINT_OUTPUT@
29+
LOG_PRINT_STACK = @LOG_PRINT_STACK@
30+
USE_FLATPAK = @USE_FLATPAK@

src/diffuse/dialogs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
import os
2121

22-
from diffuse import constants # type: ignore
22+
from diffuse import constants
2323
from diffuse import utils
2424

2525
import gi # type: ignore

0 commit comments

Comments
 (0)