Skip to content

Commit 9bfa56d

Browse files
author
Artiom N.
committed
Style fixes
1 parent dac8046 commit 9bfa56d

File tree

3 files changed

+17
-17
lines changed

3 files changed

+17
-17
lines changed

.pre-commit-config.yaml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ repos:
1010
# Common
1111
#
1212
- repo: https://github.com/pre-commit/pre-commit-hooks
13-
rev: "v4.4.0"
13+
rev: "v6.0.0"
1414
hooks:
1515
- id: check-case-conflict
1616
- id: trailing-whitespace
@@ -27,7 +27,7 @@ repos:
2727
# Git.
2828
#
2929
- repo: https://github.com/pre-commit/pre-commit-hooks
30-
rev: "v4.4.0"
30+
rev: "v6.0.0"
3131
hooks:
3232
- id: check-merge-conflict
3333
# - id: no-commit-to-branch
@@ -68,14 +68,14 @@ repos:
6868
# Python
6969
#
7070
- repo: https://github.com/pre-commit/pre-commit-hooks
71-
rev: "v4.4.0"
71+
rev: "v6.0.0"
7272
hooks:
7373
- id: debug-statements
7474
- id: check-docstring-first
7575
- id: requirements-txt-fixer
7676

7777
- repo: https://github.com/PyCQA/autoflake
78-
rev: v2.2.0
78+
rev: v2.3.1
7979
hooks:
8080
- id: autoflake
8181
exclude: &fixtures tests(/\w*)*/functional/|tests/input|doc/data/messages|tests(/\w*)*data/
@@ -87,7 +87,7 @@ repos:
8787
- --remove-unused-variables
8888

8989
- repo: https://github.com/pycqa/pylint
90-
rev: "v3.0.0a7" # pylint-2.14.5
90+
rev: "v4.0.4" # pylint-2.14.5
9191
hooks:
9292
- id: pylint
9393
args: ["-rn", "-sn", "--rcfile=src/.pylintrc", "--fail-on=I", "--load-plugins=pylint.extensions.docparams"]
@@ -98,7 +98,7 @@ repos:
9898
exclude: tests(/\w*)*/functional/|tests/input|tests(/\w*)*data/|doc/
9999
stages: [manual]
100100
- repo: https://github.com/PyCQA/flake8
101-
rev: 6.1.0
101+
rev: 7.3.0
102102
hooks:
103103
- id: flake8
104104
args: ["--config", "src/.flake8"]
@@ -107,12 +107,12 @@ repos:
107107
exclude: ".*fixtures"
108108

109109
- repo: https://github.com/pre-commit/pre-commit
110-
rev: v3.3.3
110+
rev: v4.5.0
111111
hooks:
112112
- id: validate_manifest
113113

114114
- repo: https://github.com/pre-commit/mirrors-mypy
115-
rev: v1.5.1
115+
rev: v1.19.0
116116
hooks:
117117
- id: mypy
118118
args: ["--config-file", "src/.mypy.ini", "--install-types"]
@@ -134,25 +134,25 @@ repos:
134134
# exclude: tests(/\w*)*/functional/|tests/input|tests(/.*)+/conftest.py|doc/data/messages|tests(/\w*)*data/
135135

136136
- repo: https://github.com/asottile/pyupgrade
137-
rev: v3.10.1
137+
rev: v3.21.2
138138
hooks:
139139
- id: pyupgrade
140140

141141
- repo: https://github.com/ambv/black
142-
rev: "23.7.0"
142+
rev: "25.12.0"
143143
hooks:
144144
- id: black
145145
args: ["-l", "120", "--skip-string-normalization"]
146146

147147
- repo: https://github.com/DanielNoord/pydocstringformatter
148-
rev: v0.7.3
148+
rev: v0.7.5
149149
hooks:
150150
- id: pydocstringformatter
151151
exclude: *fixtures
152152
args: ["--max-summary-lines=2", "--linewrap-full-docstring"]
153153

154154
- repo: https://github.com/PyCQA/bandit
155-
rev: 1.7.5
155+
rev: 1.9.2
156156
hooks:
157157
- id: bandit
158158
args: ["-r", "-lll", "-c", ".bandit"]
@@ -175,6 +175,6 @@ repos:
175175
# - id: markdownlint
176176

177177
- repo: https://github.com/executablebooks/mdformat
178-
rev: "0.7.16"
178+
rev: "1.0.0"
179179
hooks:
180180
- id: mdformat

src/book02/ch03/python/mt_server/mt-file-server1.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def __init__(self, client_sock: socket.socket):
2828
def socket(self):
2929
return self._client_sock
3030

31-
def send_buffer(self, buffer):
31+
def send_buffer(self, buffer: bytes):
3232
self._client_sock.sendall(buffer)
3333

3434
def send_file(self, file_path: Path):

src/book02/ch04/cpp/select_aio_server/main.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ extern "C"
3434
#include <socket_wrapper/socket_wrapper.h>
3535

3636

37-
const auto clients_count = 10;
38-
const auto buffer_size = 4096;
37+
constexpr auto clients_count = 10;
38+
constexpr auto buffer_size = 4096;
3939
using namespace std::literals;
4040
namespace fs = std::filesystem;
4141

@@ -55,7 +55,7 @@ const wchar_t separ = *reinterpret_cast<const wchar_t *>(&fs::path::preferred_se
5555

5656
void set_nonblock(SocketDescriptorType fd)
5757
{
58-
const IoctlType flag = 1;
58+
constexpr IoctlType flag = 1;
5959

6060
if (ioctl(fd, FIONBIO, const_cast<IoctlType *>(&flag)) < 0)
6161
{

0 commit comments

Comments
 (0)