From e4fc718168a2ef03d9d9af883ee5db8b3fad3ec0 Mon Sep 17 00:00:00 2001 From: Julia Date: Tue, 31 Mar 2026 22:26:43 +0200 Subject: [PATCH 1/2] Merge conflicts resolved --- .pre-commit-config.yaml | 4 ++-- README.md | 3 +++ moduleA.py | 10 ++++++++++ pyproject.toml | 1 - test_moduleA.py | 6 ++++++ 5 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 README.md create mode 100644 moduleA.py create mode 100644 test_moduleA.py diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a00cee1..9afa737 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -10,9 +10,9 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit rev: v0.3.0 hooks: - - id: ruff # Linting + - id: ruff # Linting - repo: https://github.com/psf/black - rev: stable + rev: 24.4.2 hooks: - id: black # formatting diff --git a/README.md b/README.md new file mode 100644 index 0000000..bd945f2 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# README + +neuer Branch -> Übung1 (mit Tag) und PR diff --git a/moduleA.py b/moduleA.py new file mode 100644 index 0000000..b7f0906 --- /dev/null +++ b/moduleA.py @@ -0,0 +1,10 @@ +def addition(a=1, b=2): + return a + b + + +def f(x: int, y: int) -> int: + return x + y + + +if __name__ == "__main__": + print(addition(5, 5)) diff --git a/pyproject.toml b/pyproject.toml index d6609b8..3c32f93 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,2 @@ [tool.pytest.ini_options] pythonpath = ["."] - diff --git a/test_moduleA.py b/test_moduleA.py new file mode 100644 index 0000000..42fe6cc --- /dev/null +++ b/test_moduleA.py @@ -0,0 +1,6 @@ +from src.moduleA import addition + + +def test_a(): + assert addition() == 3 + assert addition(5, 5) == 10 -- 2.30.2 From a20a178effcc56fa4fe0b7d40c5f4e3b816cae21 Mon Sep 17 00:00:00 2001 From: Julia Date: Mon, 6 Apr 2026 11:17:16 +0200 Subject: [PATCH 2/2] Codewars_Aufgabe:_VersionManager --- src/Codewars_Exercises/Versions_manager.py | 47 ++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 src/Codewars_Exercises/Versions_manager.py diff --git a/src/Codewars_Exercises/Versions_manager.py b/src/Codewars_Exercises/Versions_manager.py new file mode 100644 index 0000000..31e3af7 --- /dev/null +++ b/src/Codewars_Exercises/Versions_manager.py @@ -0,0 +1,47 @@ +class VersionManager: + + def __init__(self, version="0.0.1"): + self.version = version + if self.version == "": + self.version = "0.0.1" + self.digits = self.version.split(sep=".") + while len(self.digits) < 3: + self.digits.append("0") + if not ( + self.digits[0].isdecimal() + and self.digits[1].isdecimal() + and self.digits[2].isdecimal() + ): + raise Exception("Error occured while parsing version!") + self.MAJOR = int(self.digits[0]) + self.MINOR = int(self.digits[1]) + self.PATCH = int(self.digits[2]) + self.history = [] + + def major(self): + self.history.append((self.MAJOR, self.MINOR, self.PATCH)) + self.MAJOR += 1 + self.MINOR = 0 + self.PATCH = 0 + return self + + def minor(self): + self.history.append((self.MAJOR, self.MINOR, self.PATCH)) + self.MINOR += 1 + self.PATCH = 0 + return self + + def patch(self): + self.history.append((self.MAJOR, self.MINOR, self.PATCH)) + self.PATCH += 1 + return self + + def rollback(self): + if len(self.history) < 1: + raise Exception("Cannot rollback!") + else: + self.MAJOR, self.MINOR, self.PATCH = self.history.pop() + return self + + def release(self): + return f"{self.MAJOR}.{self.MINOR}.{self.PATCH}" -- 2.30.2