Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/topic/timw/python-upgrade'
Browse files Browse the repository at this point in the history
* origin/topic/timw/python-upgrade:
  Update cmake submodule to master
  Update trace-summary submodule for python upgrade
  Update pysubnettree submodule
  Add workflow for running pre-commit
  Update codeql action versions, add linting for workflows
  Fix references to python 3.5 in CMakeLists and docs
  Add 'F' to ruff, fix findings
  Add 'ISC' to ruff, fix findings (there weren't any)
  Add 'I' to ruff, fix findings
  Add 'C4' to ruff, fix findings
  Use f-strings or .format() for string formatting
  Add ruff linting, enabling and fixing the 'upgrade' finds
  Add pre-commit hook for ruff-format, fix all of the findings
  Add pre-commit for trailing whitespace, fix findings
  Remove long-outdated travis configuration
  • Loading branch information
timwoj committed Dec 11, 2024
2 parents 7e1a844 + 56e92df commit 67ae699
Show file tree
Hide file tree
Showing 104 changed files with 2,444 additions and 1,398 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,24 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality


- name: Autobuild
uses: github/codeql-action/autobuild@v2
uses: github/codeql-action/autobuild@v3

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
14 changes: 14 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: pre-commit

on:
pull_request:
push:
branches: [master]

jobs:
pre-commit:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: pre-commit/[email protected]
22 changes: 22 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
exclude: (^testing/Baseline|^auxil)
- id: end-of-file-fixer
exclude: (^testing/Baseline|examples/.*Baseline.*|^auxil)

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.1
hooks:
- id: ruff-format
- id: ruff
args: [--fix]

- repo: https://github.com/rhysd/actionlint
rev: v1.7.4
hooks:
- id: actionlint
42 changes: 0 additions & 42 deletions .travis.yml

This file was deleted.

3 changes: 1 addition & 2 deletions BroControl/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from __future__ import print_function
import sys

msg="""
msg = """
Error: ZeekControl plugin uses legacy BroControl API. Use
'import ZeekControl.plugin' instead of 'import BroControl.plugin'.
"""
Expand Down
1 change: 1 addition & 0 deletions BroControl/cmdresult.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
#

import ZeekControl.cmdresult

CmdResult = ZeekControl.cmdresult.CmdResult
1 change: 1 addition & 0 deletions BroControl/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
#

import ZeekControl.config

Config = ZeekControl.config.Config
1 change: 1 addition & 0 deletions BroControl/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
#

import ZeekControl.plugin

Plugin = ZeekControl.plugin.Plugin
35 changes: 35 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,38 @@
2.5.0-74 | 2024-12-10 17:22:23 -0700

* Update cmake submodule to master (Tim Wojtulewicz, Corelight)

* Update trace-summary submodule for python upgrade (Tim Wojtulewicz, Corelight)

* Update pysubnettree submodule (Tim Wojtulewicz, Corelight)

* Add workflow for running pre-commit (Tim Wojtulewicz, Corelight)

* Update codeql action versions, add linting for workflows (Tim Wojtulewicz, Corelight)

* Fix references to python 3.5 in CMakeLists and docs (Tim Wojtulewicz, Corelight)

* Add 'F' to ruff, fix findings (Tim Wojtulewicz, Corelight)

* Add 'ISC' to ruff, fix findings (there weren't any) (Tim Wojtulewicz, Corelight)

* Add 'I' to ruff, fix findings (Tim Wojtulewicz, Corelight)

* Add 'C4' to ruff, fix findings (Tim Wojtulewicz, Corelight)

* Use f-strings or .format() for string formatting (Tim Wojtulewicz, Corelight)

* Add ruff linting, enabling and fixing the 'upgrade' finds (Tim Wojtulewicz, Corelight)

This disables the format string finding (UP031) temporarily. It is
handled in a separate commit because it's so many changes.

* Add pre-commit hook for ruff-format, fix all of the findings (Tim Wojtulewicz, Corelight)

* Add pre-commit for trailing whitespace, fix findings (Tim Wojtulewicz, Corelight)

* Remove long-outdated travis configuration (Tim Wojtulewicz, Corelight)

2.5.0-58 | 2024-08-08 09:25:59 -0700

* Stop installing the broctl symlink (Tim Wojtulewicz, Corelight)
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ endif ()

find_package(Zeek)
list(APPEND Python_ADDITIONAL_VERSIONS 3)
set(ZEEKCTL_PYTHON_MIN 3.5.0)
set(ZEEKCTL_PYTHON_MIN 3.9.0)
find_package(Python ${ZEEKCTL_PYTHON_MIN} REQUIRED COMPONENTS Interpreter)
find_package(SubnetTree)
find_package(PCAP)
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.5.0-58
2.5.0-74
2 changes: 1 addition & 1 deletion ZeekControl/cmdresult.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from ZeekControl import node as node_mod


class CmdResult:
"""Class representing the result of a zeekctl command."""

Expand Down Expand Up @@ -104,4 +105,3 @@ def set_node_data(self, node, success, data):
else:
self.fail_count += 1
self.ok = False

Loading

0 comments on commit 67ae699

Please sign in to comment.