Skip to content

Commit 75e3a07

Browse files
authored
Merge pull request #234 from sir-gon/sonarlint
[REFACTOR] sonarlint fixes
2 parents 6c60060 + 82b9c81 commit 75e3a07

File tree

3 files changed

+10
-11
lines changed

3 files changed

+10
-11
lines changed

Dockerfile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
FROM python:3.11.3-alpine3.16 as base
1+
FROM python:3.11.3-alpine3.16 AS base
22

33
ENV WORKDIR=/app
44
WORKDIR ${WORKDIR}
55

6-
FROM node:20.2.0-alpine3.16 as lint
6+
FROM node:20.2.0-alpine3.16 AS lint
77

88
ENV WORKDIR=/app
99
WORKDIR ${WORKDIR}
@@ -15,11 +15,11 @@ RUN npm install -g markdownlint-cli
1515
RUN apk add --update --no-cache nodejs npm
1616
RUN npm install -g pyright
1717

18-
FROM base as development
18+
FROM base AS development
1919

2020
RUN apk add --update --no-cache make
2121

22-
FROM development as builder
22+
FROM development AS builder
2323

2424
COPY ./src ${WORKDIR}/src
2525
COPY ./requirements.txt ${WORKDIR}/
@@ -34,7 +34,7 @@ RUN pip install -r requirements.txt
3434
##
3535
## https://docs.github.com/en/actions/creating-actions/dockerfile-support-for-github-actions
3636
##
37-
FROM builder as testing
37+
FROM builder AS testing
3838

3939
ENV LOG_LEVEL=INFO
4040
ENV BRUTEFORCE=false
@@ -51,7 +51,7 @@ CMD ["make", "test", "-e", "{DEBUG}"]
5151
## in the production phase, "good practices" such as
5252
## WORKSPACE and USER are maintained
5353
##
54-
FROM builder as production
54+
FROM builder AS production
5555

5656
ENV LOG_LEVEL=INFO
5757
ENV BRUTEFORCE=false

src/projecteuler/helpers/matrix.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
def matrix(t_n: int, t_m: int, init: int | None) -> List[List[int]]:
66
result = []
77

8-
for i in range(0, t_n):
9-
result.append([init for i in range(t_m)])
8+
for _ in range(0, t_n):
9+
result.append([init for _ in range(t_m)])
1010
return result

src/projecteuler/lib/binary_node_builder.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,8 @@ def build_binary_node_tree_weigth(
6565
)
6666
)
6767

68-
if result_node.is_leaf():
69-
if leaves_collector is not None:
70-
leaves_collector.append(current_value)
68+
if result_node.is_leaf() and leaves_collector is not None:
69+
leaves_collector.append(current_value)
7170

7271
return result_node
7372

0 commit comments

Comments
 (0)