Loading .gitignore +8 −0 Original line number Diff line number Diff line .* *.pyc .coverage .eggs .mypy_cache/ build dist mat2.egg-info tags .gitlab-ci.yml +41 −6 Original line number Diff line number Diff line Loading @@ -6,22 +6,57 @@ stages: bandit: stage: linting script: script: # TODO: remove B405 and B314 - apt-get -qqy update - apt-get -qqy install --no-install-recommends python3-bandit - bandit -r ./src --format txt --skip B404,B603 - bandit ./mat2 --format txt - bandit -r ./nautilus/ --format txt --skip B101 - bandit -r ./libmat2 --format txt --skip B101,B404,B603,B405,B314 pylint: stage: linting script: - apt-get -qqy update - apt-get -qqy install --no-install-recommends pylint3 python3-mutagen python3-gi-cairo gir1.2-poppler-0.18 gir1.2-gdkpixbuf-2.0 - pylint3 --extension-pkg-whitelist=cairo,gi ./libmat2 ./mat2 # Once nautilus-python is in Debian, decomment it form the line below - pylint3 --extension-pkg-whitelist=Nautilus,GObject,Gtk,Gio,GLib,gi ./nautilus/mat2.py pyflakes: stage: linting script: - apt-get -qqy update - apt-get -qqy install --no-install-recommends pyflakes3 - pyflakes3 ./src - pyflakes3 ./libmat2 ./mat2 ./tests/ ./nautilus tests: mypy: stage: linting script: - apt-get -qqy update - apt-get -qqy install --no-install-recommends python3-pip - pip3 install mypy - mypy mat2 libmat2/*.py --ignore-missing-imports - mypy --ignore-missing-imports ./nautilus/mat2.py tests:debian: stage: test script: - apt-get -qqy update - apt-get -qqy install --no-install-recommends python3-mutagen python3-gi-cairo gir1.2-poppler-0.18 gir1.2-gdkpixbuf-2.0 libimage-exiftool-perl python3-coverage - python3-coverage run -m unittest discover -s tests/ - python3-coverage report -m --include 'src/*' - python3-coverage run --branch -m unittest discover -s tests/ - python3-coverage report -m --include 'libmat2/*' tests:fedora: image: fedora stage: test script: - dnf install -y python3 python3-mutagen python3-gobject gdk-pixbuf2 poppler-glib gdk-pixbuf2 gdk-pixbuf2-modules cairo-gobject cairo python3-cairo perl-Image-ExifTool mailcap - gdk-pixbuf-query-loaders-64 > /usr/lib64/gdk-pixbuf-2.0/2.10.0/loaders.cache - python3 setup.py test tests:archlinux: image: archlinux/base stage: test script: - pacman -Sy --noconfirm python-mutagen python-gobject gdk-pixbuf2 poppler-glib gdk-pixbuf2 python-cairo perl-image-exiftool python-setuptools mailcap - python3 setup.py test .pylintrc 0 → 100644 +16 −0 Original line number Diff line number Diff line [FORMAT] good-names=e,f,i,x,s max-locals=20 [MESSAGES CONTROL] disable= fixme, invalid-name, missing-docstring, protected-access, abstract-method, wrong-import-position, catching-non-exception, cell-var-from-loop, locally-disabled, invalid-sequence-index, # pylint doesn't like things like `Tuple[int, bytes]` in type annotation CHANGELOG.md +51 −0 Original line number Diff line number Diff line # 0.3.1 - 2018-09-01 - Document how to install MAT2 for various distributions - Fix various typos in the documentation/comments - Add ArchLinux to the CI to ensure that MAT2 is running on it - Fix the handling of files with a name ending in `.JPG` - Improve the detection of unsupported extensions in upper-case - Streamline MAT2's logging # 0.3.0 - 2018-08-03 - Add a check for missing dependencies - Add Nautilus extension - Minors code simplifications - Improve our linters' coverage - Add a manpage - Add folder/multiple files related tests - Change the logo # 0.2.0 - 2018-07-10 - Fix various crashes dues to malformed files - Simplify various code-paths - Remove superfluous debug message - Remove the `--check` option that never was implemented anyway - Add a `-c` option to check for MAT2's dependencies # 0.1.3 - 2018-07-06 - Improve MAT2 resilience against corrupted images - Check that the minimal version of Poppler is available - Simplify how MAT2 deals with office files - Improve cleaning of office files - Thumbnails are removed - Revisions are removed - Add support for plain text files # 0.1.2 - 2018-06-21 - Rename some files to ease the packaging - Add linters to the CI (mypy, bandit and pyflakes) - Prevent exitftool-related parameters injections - Improve MAT2's resilience against corrupted files - Make MAT2 work on fedora, thanks to @atenart - Tighten the threat model - Simplify and improve how office files are handled # 0.1.1 - 2018-05-16 - Improve the cli usage Loading CONTRIBUTING.md +21 −4 Original line number Diff line number Diff line Loading @@ -7,10 +7,27 @@ Do feel free to pick up [an issue]( https://0xacab.org/jvoisin/mat2/issues ) and to send a pull-request. Please do check that everything is fine by running the testsuite with `python3 -m unittest discover -v` before submitting one :) If you're fixing a bug or adding a new feature, please add tests accordingly, this will greatly improve the odds of your merge-request getting merged. If you're adding a new fileformat, please add tests for: 1. Getting metadata 2. Cleaning metadata 3. Raising `ValueError` upon a corrupted file Since MAT2 is written in Python3, please conform as much as possible to the [pep8]( https://pep8.org/ ) style; except where it makes no sense of course. # Doing a release 1. Update the [changelog](https://0xacab.org/jvoisin/mat2/blob/master/CHANGELOG.md) 2. Update the version in the [main.py](https://0xacab.org/jvoisin/mat2/blob/master/main.py) file 3. Commit the changelog and the main.py file 4. Create a tag with `git tag -s $VERSION` 5. Push the tag with `git push --tags` 2. Update the version in the [mat2](https://0xacab.org/jvoisin/mat2/blob/master/mat2) file 3. Update the version in the [setup.py](https://0xacab.org/jvoisin/mat2/blob/master/setup.py) file 4. Update the version and date in the [man page](https://0xacab.org/jvoisin/mat2/blob/master/doc/mat.1) 5. Commit the changelog, man page, mat2 and setup.py files 6. Create a tag with `git tag -s $VERSION` 7. Push the commit with `git push origin master` 8. Push the tag with `git push --tags` 9. Tell the [downstreams](https://0xacab.org/jvoisin/mat2/blob/master/INSTALL.md) about it 10. Do the secret release dance Loading
.gitignore +8 −0 Original line number Diff line number Diff line .* *.pyc .coverage .eggs .mypy_cache/ build dist mat2.egg-info tags
.gitlab-ci.yml +41 −6 Original line number Diff line number Diff line Loading @@ -6,22 +6,57 @@ stages: bandit: stage: linting script: script: # TODO: remove B405 and B314 - apt-get -qqy update - apt-get -qqy install --no-install-recommends python3-bandit - bandit -r ./src --format txt --skip B404,B603 - bandit ./mat2 --format txt - bandit -r ./nautilus/ --format txt --skip B101 - bandit -r ./libmat2 --format txt --skip B101,B404,B603,B405,B314 pylint: stage: linting script: - apt-get -qqy update - apt-get -qqy install --no-install-recommends pylint3 python3-mutagen python3-gi-cairo gir1.2-poppler-0.18 gir1.2-gdkpixbuf-2.0 - pylint3 --extension-pkg-whitelist=cairo,gi ./libmat2 ./mat2 # Once nautilus-python is in Debian, decomment it form the line below - pylint3 --extension-pkg-whitelist=Nautilus,GObject,Gtk,Gio,GLib,gi ./nautilus/mat2.py pyflakes: stage: linting script: - apt-get -qqy update - apt-get -qqy install --no-install-recommends pyflakes3 - pyflakes3 ./src - pyflakes3 ./libmat2 ./mat2 ./tests/ ./nautilus tests: mypy: stage: linting script: - apt-get -qqy update - apt-get -qqy install --no-install-recommends python3-pip - pip3 install mypy - mypy mat2 libmat2/*.py --ignore-missing-imports - mypy --ignore-missing-imports ./nautilus/mat2.py tests:debian: stage: test script: - apt-get -qqy update - apt-get -qqy install --no-install-recommends python3-mutagen python3-gi-cairo gir1.2-poppler-0.18 gir1.2-gdkpixbuf-2.0 libimage-exiftool-perl python3-coverage - python3-coverage run -m unittest discover -s tests/ - python3-coverage report -m --include 'src/*' - python3-coverage run --branch -m unittest discover -s tests/ - python3-coverage report -m --include 'libmat2/*' tests:fedora: image: fedora stage: test script: - dnf install -y python3 python3-mutagen python3-gobject gdk-pixbuf2 poppler-glib gdk-pixbuf2 gdk-pixbuf2-modules cairo-gobject cairo python3-cairo perl-Image-ExifTool mailcap - gdk-pixbuf-query-loaders-64 > /usr/lib64/gdk-pixbuf-2.0/2.10.0/loaders.cache - python3 setup.py test tests:archlinux: image: archlinux/base stage: test script: - pacman -Sy --noconfirm python-mutagen python-gobject gdk-pixbuf2 poppler-glib gdk-pixbuf2 python-cairo perl-image-exiftool python-setuptools mailcap - python3 setup.py test
.pylintrc 0 → 100644 +16 −0 Original line number Diff line number Diff line [FORMAT] good-names=e,f,i,x,s max-locals=20 [MESSAGES CONTROL] disable= fixme, invalid-name, missing-docstring, protected-access, abstract-method, wrong-import-position, catching-non-exception, cell-var-from-loop, locally-disabled, invalid-sequence-index, # pylint doesn't like things like `Tuple[int, bytes]` in type annotation
CHANGELOG.md +51 −0 Original line number Diff line number Diff line # 0.3.1 - 2018-09-01 - Document how to install MAT2 for various distributions - Fix various typos in the documentation/comments - Add ArchLinux to the CI to ensure that MAT2 is running on it - Fix the handling of files with a name ending in `.JPG` - Improve the detection of unsupported extensions in upper-case - Streamline MAT2's logging # 0.3.0 - 2018-08-03 - Add a check for missing dependencies - Add Nautilus extension - Minors code simplifications - Improve our linters' coverage - Add a manpage - Add folder/multiple files related tests - Change the logo # 0.2.0 - 2018-07-10 - Fix various crashes dues to malformed files - Simplify various code-paths - Remove superfluous debug message - Remove the `--check` option that never was implemented anyway - Add a `-c` option to check for MAT2's dependencies # 0.1.3 - 2018-07-06 - Improve MAT2 resilience against corrupted images - Check that the minimal version of Poppler is available - Simplify how MAT2 deals with office files - Improve cleaning of office files - Thumbnails are removed - Revisions are removed - Add support for plain text files # 0.1.2 - 2018-06-21 - Rename some files to ease the packaging - Add linters to the CI (mypy, bandit and pyflakes) - Prevent exitftool-related parameters injections - Improve MAT2's resilience against corrupted files - Make MAT2 work on fedora, thanks to @atenart - Tighten the threat model - Simplify and improve how office files are handled # 0.1.1 - 2018-05-16 - Improve the cli usage Loading
CONTRIBUTING.md +21 −4 Original line number Diff line number Diff line Loading @@ -7,10 +7,27 @@ Do feel free to pick up [an issue]( https://0xacab.org/jvoisin/mat2/issues ) and to send a pull-request. Please do check that everything is fine by running the testsuite with `python3 -m unittest discover -v` before submitting one :) If you're fixing a bug or adding a new feature, please add tests accordingly, this will greatly improve the odds of your merge-request getting merged. If you're adding a new fileformat, please add tests for: 1. Getting metadata 2. Cleaning metadata 3. Raising `ValueError` upon a corrupted file Since MAT2 is written in Python3, please conform as much as possible to the [pep8]( https://pep8.org/ ) style; except where it makes no sense of course. # Doing a release 1. Update the [changelog](https://0xacab.org/jvoisin/mat2/blob/master/CHANGELOG.md) 2. Update the version in the [main.py](https://0xacab.org/jvoisin/mat2/blob/master/main.py) file 3. Commit the changelog and the main.py file 4. Create a tag with `git tag -s $VERSION` 5. Push the tag with `git push --tags` 2. Update the version in the [mat2](https://0xacab.org/jvoisin/mat2/blob/master/mat2) file 3. Update the version in the [setup.py](https://0xacab.org/jvoisin/mat2/blob/master/setup.py) file 4. Update the version and date in the [man page](https://0xacab.org/jvoisin/mat2/blob/master/doc/mat.1) 5. Commit the changelog, man page, mat2 and setup.py files 6. Create a tag with `git tag -s $VERSION` 7. Push the commit with `git push origin master` 8. Push the tag with `git push --tags` 9. Tell the [downstreams](https://0xacab.org/jvoisin/mat2/blob/master/INSTALL.md) about it 10. Do the secret release dance