From a29c2f44f75a759d8342720c3505fb3d30ed3c83 Mon Sep 17 00:00:00 2001 From: kleph Date: Fri, 1 Dec 2023 18:48:01 +0100 Subject: [PATCH] [lint] remove old errors to start a fresh 2023 year --- 2021/15/15.py | 14 ++++++++------ 2022/11/11.py | 1 + 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/2021/15/15.py b/2021/15/15.py index bba14a1..45b3a04 100755 --- a/2021/15/15.py +++ b/2021/15/15.py @@ -1,10 +1,11 @@ #!/usr/bin/env python # 2021 - Advent Of Code - 15 -# 2022: cheat for pylint to start fresh for 2022 -# pylint: skip-file # unfinished -class Color: +from typing import NamedTuple + + +class Color(NamedTuple): PURPLE = '\033[95m' CYAN = '\033[96m' DARKCYAN = '\033[36m' @@ -27,8 +28,9 @@ def parse_file(file): def print_grid(grid): - for y in range(len(grid)): - for x in range(len(grid[y])): + # pylint: disable=unnecessary-list-index-lookup + for y, _ in enumerate(grid): + for x, _ in enumerate(grid[y]): print(grid[y][x], end='') print() print() @@ -37,5 +39,5 @@ def print_grid(grid): cave_map = parse_file('input_example.txt') print_grid(cave_map) - +color = Color() print(color.BOLD + 'Hello World !' + color.END) diff --git a/2022/11/11.py b/2022/11/11.py index 2574824..500b800 100644 --- a/2022/11/11.py +++ b/2022/11/11.py @@ -9,6 +9,7 @@ # If false: throw to monkey 3 class Monkey: + # pylint: disable=too-many-arguments def __init__(self, sitems, op, op2, divisible, ta, tf): self.items = sitems self.operation = op