Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Require python 3.9, plus lots of linting and formatting fixes #73

Merged
merged 15 commits into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
timwoj marked this conversation as resolved.
Show resolved Hide resolved
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
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 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
Loading