Bump pre-commit hooks

This commit is contained in:
Benjamin Bannier 2023-10-10 21:22:12 +02:00
parent f5a76c1aed
commit 26d04fd9fc
13 changed files with 22 additions and 19 deletions

View file

@ -3,9 +3,12 @@
#
repos:
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: 'v13.0.0'
rev: 'v17.0.3'
hooks:
- id: clang-format
types_or:
- "c"
- "c++"
- repo: https://github.com/maxwinterstein/shfmt-py
rev: v3.7.0.1
@ -14,7 +17,7 @@ repos:
args: ["-w", "-i", "4", "-ci"]
- repo: https://github.com/google/yapf
rev: v0.40.0
rev: v0.40.2
hooks:
- id: yapf
@ -25,7 +28,7 @@ repos:
exclude: '^auxil/.*$'
- repo: https://github.com/crate-ci/typos
rev: v1.16.8
rev: v1.16.21
hooks:
- id: typos
exclude: '^(.typos.toml|src/SmithWaterman.cc|testing/.*|auxil/.*|scripts/base/frameworks/files/magic/.*|CHANGES)$'

View file

@ -154,7 +154,7 @@ int Base64Converter::Decode(int len, const char* data, int* pblen, char** pbuf)
*buf++ = char((bit32 >> 8) & 0xff);
if ( --num_octets >= 0 )
*buf++ = char((bit32)&0xff);
*buf++ = char((bit32) & 0xff);
if ( base64_padding > 0 )
base64_after_padding = 1;

View file

@ -185,8 +185,8 @@ bool DbgBreakpoint::Reset() {
case BP_STMT:
case BP_LINE:
plr.type = PLR_FUNCTION;
//### How to deal with wildcards?
//### perhaps save user choices?--tough...
// ### How to deal with wildcards?
// ### perhaps save user choices?--tough...
break;
}

View file

@ -85,7 +85,7 @@ public:
// Temporary state: vanishes when execution resumes.
//### Umesh, why do these all need to be public? -- Vern
// ### Umesh, why do these all need to be public? -- Vern
// Which frame we're looking at; 0 = the innermost frame.
int curr_frame_idx;

View file

@ -113,7 +113,7 @@ public:
if ( key_size <= 8 ) {
memcpy(key_here, arg_key, key_size);
if ( ! copy_key )
delete[](char*) arg_key; // own the arg_key, now don't need it.
delete[] (char*)arg_key; // own the arg_key, now don't need it.
}
else {
if ( copy_key ) {
@ -584,7 +584,7 @@ public:
v = table[position].value;
table[position].value = val;
if ( ! copy_key )
delete[](char*) key;
delete[] (char*)key;
if ( iterators && ! iterators->empty() )
// need to set new v for iterators too.

View file

@ -307,8 +307,8 @@ public:
delete ip6_hdrs;
if ( del ) {
delete[](struct ip*) ip4;
delete[](struct ip6_hdr*) ip6;
delete[] (struct ip*)ip4;
delete[] (struct ip6_hdr*)ip6;
}
}

View file

@ -14,7 +14,7 @@
#include "zeek/ScannedFile.h"
#include "zeek/plugin/Manager.h"
//#define MATCHER_PRINT_STATS
// #define MATCHER_PRINT_STATS
// Parser interface:

View file

@ -14,7 +14,7 @@ namespace analyzer::bittorrent {
// If the following is defined, then the analyzer will store all of
// the headers seen in tracker messages.
//#define BTTRACKER_STORE_HEADERS 1
// #define BTTRACKER_STORE_HEADERS 1
namespace detail {

View file

@ -1520,8 +1520,8 @@ void DNS_Interpreter::SendReplyOrRejectEvent(detail::DNS_MsgInfo* msg, EventHand
}
DNS_MsgInfo::DNS_MsgInfo(DNS_RawMsgHdr* hdr, int arg_is_query) {
//### Need to fix alignment if hdr is misaligned (not on a short
// boundary).
// ### Need to fix alignment if hdr is misaligned (not on a short
// boundary).
unsigned short flags = ntohs(hdr->flags);
QR = (flags & 0x8000) != 0;

View file

@ -232,7 +232,7 @@ void TelnetEnvironmentOption::RecvSubOption(u_char* data, int len) {
}
if ( data[0] == ENVIRON_SEND )
//### We should track the dialog and make sure both sides agree.
// ### We should track the dialog and make sure both sides agree.
return;
if ( data[0] != ENVIRON_IS && data[0] != ENVIRON_INFO ) {

View file

@ -206,7 +206,7 @@ public:
bool CheckHistory(uint32_t mask, char code);
void AddHistory(char code);
//### combine into a set of flags:
// ### combine into a set of flags:
EndpointState state, prev_state;
TCP_Endpoint* peer;
TCP_Reassembler* contents_processor;

View file

@ -205,7 +205,7 @@ bool ReaderBackend::OnFinish(double network_time) {
for ( unsigned int i = 0; i < num_fields; i++ )
delete (fields[i]);
delete[](fields);
delete[] (fields);
fields = nullptr;
}

View file

@ -140,7 +140,7 @@ streamsize Binary::GetChunk(char** chunk) {
streamsize bytes_read = in->gcount();
if ( ! bytes_read ) {
delete[] * chunk;
delete[] *chunk;
*chunk = nullptr;
return 0;
}