From 11b0f0fd6d812e57e367d2bab173de811ee11533 Mon Sep 17 00:00:00 2001 From: Cedric Verstege <cedric.verstege@cern.ch> Date: Thu, 27 Mar 2025 16:13:44 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- case-1-lint/functions.py | 44 ++++++++++++++++++++++++--------- ci-configs/case-1-lint/lint.yml | 2 +- 2 files changed, 34 insertions(+), 12 deletions(-) diff --git a/case-1-lint/functions.py b/case-1-lint/functions.py index a4eb05f..f44d681 100644 --- a/case-1-lint/functions.py +++ b/case-1-lint/functions.py @@ -1,15 +1,37 @@ -import math,os,time,json -def f(x):return x*2+3*math.pi**2 if x>5 else x*3+2.7182 -def g(a,b,c):return a+b*c-(b/a)+math.sin(a) -def h():return { 'key': [ 1, 2, 3,4], 'val': 'example' } +import math, os, time, json + + +def f(x): + return x * 2 + 3 * math.pi**2 if x > 5 else x * 3 + 2.7182 + + +def g(a, b, c): + return a + b * c - (b / a) + math.sin(a) + + +def h(): + return {"key": [1, 2, 3, 4], "val": "example"} + + class Horrible: - def __init__(self):self.val=0 - def m1(self,a):self.val+=a - def m2(self):return self.val - def m3(self):return self.val*10 - def m4(self,a):self.val-=a -a=Horrible() + def __init__(self): + self.val = 0 + + def m1(self, a): + self.val += a + + def m2(self): + return self.val + + def m3(self): + return self.val * 10 + + def m4(self, a): + self.val -= a + + +a = Horrible() a.m1(5) a.m2() a.m4(3) -print(f(a.m2())+g(2,3,4)-h()['key'][2]*a.m3()) +print(f(a.m2()) + g(2, 3, 4) - h()["key"][2] * a.m3()) diff --git a/ci-configs/case-1-lint/lint.yml b/ci-configs/case-1-lint/lint.yml index 7189631..c00acea 100644 --- a/ci-configs/case-1-lint/lint.yml +++ b/ci-configs/case-1-lint/lint.yml @@ -1,4 +1,4 @@ -lint: +❄️8⬛: stage: 🕵️ image: python:3.11 script: -- GitLab