ci: call the linters on the installed directory

This commit is contained in:
Romain Failliot 2021-11-24 18:55:16 -05:00
parent 70ba837431
commit 124d086009
8 changed files with 25 additions and 27 deletions

View File

@ -2,6 +2,3 @@
builtins = _
max-line-length = 100
show-source = true
# Temporary
exclude = src/diffuse/main.py

View File

@ -18,34 +18,38 @@ jobs:
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- run: sudo apt install libgirepository1.0-dev
- run: pip install -r requirements.txt
- name: Flake8
run: flake8 src/ po/
- name: MyPy
run: mypy src/ po/
meson-build-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- name: Install dependencies
run: sudo apt-get -y install appstream appstream-util desktop-file-utils gettext
run: |
sudo apt-get -y install libgirepository1.0-dev appstream appstream-util desktop-file-utils gettext
pip install -r requirements.txt
- name: Meson build
uses: BSFishy/meson-build@v1.0.3
with:
action: build
setup-options: --prefix=/tmp/diffuse
- name: Meson test
uses: BSFishy/meson-build@v1.0.3
with:
action: test
- name: Meson install
uses: BSFishy/meson-build@v1.0.3
with:
action: install
- name: Flake8
run: |
flake8 /tmp/diffuse/
flake8 po/
- name: MyPy
run: |
mypy /tmp/diffuse/
mypy po/
flatpak-build-test:
runs-on: ubuntu-latest
container:

View File

@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
io.github.mightycreak.Diffuse.appdata.xml.in
- Leaner README.md
- Moved the documentation to docs/
- In the CI, call the linters on the installed directory
### Fixed
- Removed the lasting lint errors (i.e. in main.py)

View File

@ -2,4 +2,4 @@
#
# Copyright (C) 2006-2009 Derrick Moser <derrick_moser@yahoo.com>
import @pkgdatadir@/syntax/*.syntax
import @PKGDATADIR@/syntax/*.syntax

View File

@ -33,7 +33,7 @@ endif
# Diffuse config file
conf = configuration_data()
conf.set('pkgdatadir', pkgdatadir)
conf.set('PKGDATADIR', pkgdatadir)
configure_file(
input: 'diffuserc.in',

View File

@ -23,9 +23,8 @@ COPYRIGHT = '''{copyright} © 2006-2019 Derrick Moser
{copyright} © 2015-2021 Romain Failliot'''.format(copyright=_("Copyright")) # type: ignore
WEBSITE = 'https://mightycreak.github.io/diffuse/'
LOCALEDIR = '@LOCALEDIR@'
SYSCONFIGDIR = '@SYSCONFIGDIR@'
USE_FLATPAK = @USE_FLATPAK@
LOG_PRINT_OUTPUT = @LOG_PRINT_OUTPUT@
LOG_PRINT_STACK = @LOG_PRINT_STACK@
USE_FLATPAK = @USE_FLATPAK@

View File

@ -21,7 +21,6 @@ import os
import sys
import codecs
import encodings
import gettext
import shlex
import stat
import webbrowser
@ -1754,8 +1753,6 @@ GObject.signal_new('save-as', Diffuse.FileDiffViewer.PaneHeader, GObject.SignalF
def main():
gettext.install('diffuse', LOCALEDIR)
# app = Application()
# return app.run(sys.argv)

View File

@ -5,7 +5,8 @@ python = import('python')
conf = configuration_data()
conf.set('PYTHON', python.find_installation('python3').path())
conf.set('pkgdatadir', pkgdatadir)
conf.set('PKGDATADIR', pkgdatadir)
conf.set('LOCALEDIR', join_paths(get_option('prefix'), get_option('localedir')))
configure_file(
input: 'diffuse.in',
@ -17,7 +18,6 @@ configure_file(
conf = configuration_data()
conf.set('VERSION', meson.project_version())
conf.set('LOCALEDIR', join_paths(get_option('prefix'), get_option('localedir')))
conf.set('SYSCONFIGDIR', join_paths(get_option('prefix'), get_option('sysconfdir')))
conf.set('LOG_PRINT_OUTPUT', get_option('log_print_output'))
conf.set('LOG_PRINT_STACK', get_option('log_print_stack'))