22 Commits

Author SHA1 Message Date
Liaiss Merzougue
574af8e16b Fix ARG005 Rule
This rule detects for the presence of unused arguments in lambda expression definitions.

for details see: https://docs.astral.sh/ruff/rules/unused-lambda-argument/

The fix was done manually

Ref: it/org/software-supply-chain/production-pipeline/issues#204
2026-02-04 10:45:19 +00:00
Liaiss Merzougue
6850119c0e Fix RUF005 rule
This rule requests to consider {expression} instead of concatenation, for
details see https://docs.astral.sh/ruff/rules/collection-literal-concatenation/

These fix was automatically made by ruff with the command:

  'ruff check --select RUF005 --unsafe-fixes --fix'

but a manual change on src/e3/anod/store/__init__.py was needed to fix C409
flake8 rules

Ref: it/org/software-supply-chain/production-pipeline/issues#204
2026-02-03 17:17:57 +01:00
Liaiss Merzougue
fe760273a8 Correct ANN201 ruff rules
This rules is to detect function without return annotation, most of
them was fixed automatically by ruff, 19 was done manually

Ref: it/org/software-supply-chain/production-pipeline/issues#193
2026-01-19 09:52:37 +00:00
JulienBortolussiAda
19309af84c e3.diff.patch raise EmptyDiffError when doing nothing
Raise a specialize error when e3.diff.patch do nothing. These can happen
when all the patched file are discarded.
2023-09-21 10:24:07 +02:00
Liaiss Merzougue
179c95e189 Fix black, mypy, and flake8 issue. 2023-03-29 11:24:38 +02:00
Léo Cardao
8e01b254f5 Add an exception in e3.diff.patch function
Change the e3.diff.patch function to raise
an exception if there is no file to patch.

TN: S909-004
2022-11-02 16:32:17 +01:00
Nicolas Roche
00c4c3328a Ensure that git binary patch are handled correctly
The feature is already supported but add a test to confirm
2020-12-02 22:51:57 -08:00
Nicolas Roche
57bc6a225a Improve detection of patch for which git apply should be used
* patch generated with git show do not have diff --git as first line.
  Now consider any patch with a line starting with diff --git as a git
  patch
* use git apply only if we are sure user did not removed/adjusted
  the default prefix used when doing git diff or git show

Part of TC02-014
2020-12-02 03:30:45 -08:00
Nicolas Roche
03d21ba40a Add support for patches generated with git diff
* Use git apply when a patch starts with git --diff
* Adjust heuristic so that discarded_files parameter works on these
patches

Part of TA07-020
2020-11-24 23:42:43 -08:00
Olivier Ramonat
0e29714e7d Fix flake8 newly detected issues
See www.flake8rules.com/rules/E741.html
2020-05-14 16:31:50 +02:00
Olivier Ramonat
dca89c73c6 Remove default "r" mode passed to open() 2020-04-03 18:28:40 +02:00
Olivier Ramonat
b7f824e517 Convert code to Python3 using 2to3 and black
Code converted using:
   $ 2to3-3.7 -w --no-diffs -j8 --nobackups e3/ tests docs/*.py
   $ black e3 setup.py tests docs/*.py
   $ sed -i -e '/2to3/d' setup.py

TN: T113-010
2020-03-12 12:41:42 +01:00
Nicolas Roche
b750a823bf Review patch discarding mechanism
Fix issue where Ada line start with '-- ' was matched as the start
of a patch.
2018-02-02 10:01:02 +01:00
Olivier Ramonat
6335cc5602 Check tests style with "tox -e checkstyle"
Fix detected errors
2017-01-24 21:20:53 +01:00
Olivier Ramonat
f3ed5b7ae5 Sort imports by running isort
This change was done by running:

  isort -rc e3 && isort -rc tests

Closes #15
2016-11-26 15:20:17 +01:00
Olivier Ramonat
bc4bb636bd pytest-capturelog seems unmaintained, use pytest-catchlog instead
caplog.text and caplog.records are now properties

Change-Id: Id206801f158ca176c1ac24823046b6a46006e055
2016-10-15 18:38:33 +02:00
Olivier Ramonat
3e8f23393e Full line coverage for e3.diff
Change-Id: Ie30efe383f6ffb84cc0c78a2419aee18567763c2
2016-10-14 11:16:44 +02:00
Olivier Ramonat
c0d3cffdce Add missing absolute_import imports
Change-Id: Ice41d1f0a9d9e8420da81992c7d1c19fae674300
2016-07-22 15:40:09 +02:00
Olivier Ramonat
4d808c5163 Remove usage of tempfile in tests
All tests are already run from a temp dir, we don't need to create
other temp dirs inside the tests.

Change-Id: I6bd348bf15764c2f2054c16659b77d1da055f059
2016-07-22 11:55:27 +02:00
Olivier Ramonat
1ccc919c41 Fix some docstrings (PEP 257)
Change-Id: I794eb8369038e6f0a90bafc3cc3633744c281362
2016-07-21 22:52:03 +02:00
Nicolas Roche
692e8df810 Add new tests on e3.fs and e3.diff
Change-Id: Ie907532328379a559b119a03d06c5c57b8cc95bc
2016-04-21 16:38:06 +01:00
Valentine Reboul
752149289e Reorganize tests for public testsuite
part of OC03-027

Change-Id: Ifcc748355354296f1ae5b8797c5f5e6a0b85356a
2015-12-21 11:24:42 +01:00