Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/topic/timw/unify-python-pre-comm…
Browse files Browse the repository at this point in the history
…its'

* origin/topic/timw/unify-python-pre-commits:
  Standardize on ruff for python formatting/linting via pre-commits
  • Loading branch information
timwoj committed Apr 10, 2024
2 parents 3ee29db + 4551ae1 commit 06dea74
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 23 deletions.
12 changes: 5 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,16 @@ repos:
exclude: testing/baselines
- id: check-yaml
- id: check-added-large-files
- repo: https://github.com/psf/black
rev: 23.1a1
hooks:
- id: black
- repo: https://github.com/asottile/pyupgrade
rev: v3.15.1
hooks:
- id: pyupgrade
args: ["--py37-plus"]
- repo: https://github.com/pycqa/flake8
rev: 5.0.4 # 6.0.0 requires Python 3.8
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.0
hooks:
- id: flake8
- id: ruff
args: [--fix]
- id: ruff-format

exclude: doc/ext/sphinxarg
4 changes: 4 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
3.0.1-8 | 2024-04-10 09:34:51 -0700

* Standardize on ruff for python formatting/linting via pre-commits (Tim Wojtulewicz, Corelight)

3.0.1-6 | 2024-03-12 11:09:28 -0700

* Use default Python version for GH pre-commit workflow (Benjamin Bannier, Corelight)
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.0.1-6
3.0.1-8
2 changes: 1 addition & 1 deletion doc/man/zkg.1
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.TH "ZKG" "1" "Mar 12, 2024" "3.0.1-6" "Zeek Package Manager"
.TH "ZKG" "1" "Apr 10, 2024" "3.0.1-8" "Zeek Package Manager"
.SH NAME
zkg \- Zeek Package Manager
.sp
Expand Down
12 changes: 6 additions & 6 deletions zeekpkg/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@

import logging

__version__ = "3.0.1-6"
__all__ = ["manager", "package", "source", "template", "uservar"]
__version__ = "3.0.1-8"
__all__ = ["manager", "package", "source", "template", "uservar"] # noqa: F405

LOG = logging.getLogger(__name__)
LOG.addHandler(logging.NullHandler())

from .manager import *
from .package import *
from .source import *
from .uservar import *
from .manager import * # noqa: E402, F403
from .package import * # noqa: E402, F403
from .source import * # noqa: E402, F403
from .uservar import * # noqa: E402, F403
5 changes: 2 additions & 3 deletions zeekpkg/template.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
A module for instantiating different types of Zeek packages.
"""

import abc
import configparser
import re
Expand Down Expand Up @@ -797,9 +798,7 @@ def _git_init(self, tmpl):
"""Initial commit.
zkg {} created this package from template "{}"
using {}{}.""".format(
__version__, tmpl.name(), ver_info, features_info
)
using {}{}.""".format(__version__, tmpl.name(), ver_info, features_info)
)


Expand Down
1 change: 1 addition & 0 deletions zeekpkg/uservar.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
by packages that the user can provide in a variety of ways, including
responses to zkg's input prompting.
"""

import os
import re
import readline
Expand Down
10 changes: 5 additions & 5 deletions zkg
Original file line number Diff line number Diff line change
Expand Up @@ -85,26 +85,26 @@ ZKG_DEFAULT_SOURCE = "https://github.com/zeek/packages"
# The default package template
ZKG_DEFAULT_TEMPLATE = "https://github.com/zeek/package-template"

from zeekpkg._util import (
from zeekpkg._util import ( # noqa: E402
delete_path,
make_dir,
find_program,
read_zeek_config_line,
std_encoding,
)
from zeekpkg.package import (
from zeekpkg.package import ( # noqa: E402
BUILTIN_SCHEME,
TRACKING_METHOD_VERSION,
)
from zeekpkg.template import (
from zeekpkg.template import ( # noqa: E402
LoadError,
Template,
)
from zeekpkg.uservar import (
from zeekpkg.uservar import ( # noqa: E402
UserVar,
)

import zeekpkg
import zeekpkg # noqa: E402


def confirmation_prompt(prompt, default_to_yes=True):
Expand Down

0 comments on commit 06dea74

Please sign in to comment.