Skip to content

Commit

Permalink
Merge pull request #1070 from rmartin16/pre-commit-autoupdate
Browse files Browse the repository at this point in the history
Check for updates to `pre-commit` hooks every Sunday
  • Loading branch information
freakboy3742 authored Feb 2, 2023
2 parents 5bfc557 + e6650aa commit bc68cf4
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 4 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/pre-commit-update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Update pre-commit

on:
schedule:
- cron: "0 20 * * SUN" # Sunday @ 2000 UTC
workflow_dispatch:

jobs:
pre-commit-update:
name: Update pre-commit
uses: beeware/.github/.github/workflows/pre-commit-update.yml@main
secrets: inherit
5 changes: 2 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,11 @@ repos:
- id: pyupgrade
args: [--py38-plus]
- repo: https://github.com/psf/black
rev: 22.12.0
rev: 23.1.0
hooks:
- id: black
language_version: python3
- repo: https://github.com/PyCQA/flake8
rev: 5.0.4
rev: 6.0.0
hooks:
- id: flake8
additional_dependencies: [flake8-eradicate==1.4.0]
1 change: 1 addition & 0 deletions changes/1070.misc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
A GitHub workflow now runs every Sunday at 2000 UTC to check for updates to ``pre-commit`` hooks and commits them to a new PR.
1 change: 0 additions & 1 deletion src/briefcase/platforms/web/static.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,6 @@ def package_app(self, app: AppConfig, packaging_format: str, **kwargs):
with ZipFile(
self.distribution_path(app, packaging_format=packaging_format), "w"
) as archive:

for filename in self.project_path(app).glob("**/*"):
self.logger.info(
f"Adding {filename.relative_to(self.project_path(app))}"
Expand Down
3 changes: 3 additions & 0 deletions tests/commands/run/test_LogFilter.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ def test_default_filter():

def test_clean_filter():
"""A cleaning filter can be used to strip content."""

# Define a cleaning filter that strips the first 5 characters,
# and identifies all content as Python
def clean_filter(line):
Expand All @@ -54,6 +55,7 @@ def clean_filter(line):
def test_clean_filter_unclean_output():
"""A cleaning filter can be used to strip content, but doesn't have to alter
output."""

# Define a cleaning filter that strips the first 5 characters,
# and identifies all content as Python
def clean_filter(line):
Expand Down Expand Up @@ -209,6 +211,7 @@ def test_log_filter(
returncode,
):
"""The log filter behaves as expected."""

# Define a clean filter that removes an index at the start of the line, only
# analyses content with an even prefix, and dumps content that starts "DUMP:"
def clean_filter(line):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ def monkeypatch_ensure_str(value):

def test_filter_func(mock_sub, streaming_process, capsys):
"""A filter can be added to modify an output stream."""

# Define a filter function that converts "output" into "filtered"
def filter_func(line):
yield line.replace("output", "filtered")
Expand All @@ -177,6 +178,7 @@ def filter_func(line):

def test_filter_func_reject(mock_sub, streaming_process, capsys):
"""A filter that rejects lines can be added to modify an output stream."""

# Define a filter function that ignores blank lines
def filter_func(line):
if len(line) == 0:
Expand All @@ -198,6 +200,7 @@ def filter_func(line):

def test_filter_func_line_ends(mock_sub, streaming_process, capsys):
"""Filter functions are not provided the newline."""

# Define a filter function that redacts lines that end with 1
# The newline is *not* included.
def filter_func(line):
Expand All @@ -222,6 +225,7 @@ def filter_func(line):

def test_filter_func_line_multiple_output(mock_sub, streaming_process, capsys):
"""Filter functions can generate multiple lines from a single input."""

# Define a filter function that adds an extra line of content when the
# lines that end with 1
def filter_func(line):
Expand All @@ -246,6 +250,7 @@ def filter_func(line):

def test_filter_func_stop_iteration(mock_sub, streaming_process, capsys):
"""A filter can indicate that logging should stop."""

# Define a filter function that converts "output" into "filtered",
# and terminates streaming when a blank line is seen.
def filter_func(line):
Expand All @@ -267,6 +272,7 @@ def filter_func(line):

def test_filter_func_output_and_stop_iteration(mock_sub, streaming_process, capsys):
"""A filter can indicate that logging should stop, and also output content."""

# Define a filter function that converts "output" into "filtered",
# and terminates streaming when a blank line is seen; but outputs
# one more line before terminating.
Expand All @@ -291,6 +297,7 @@ def filter_func(line):

def test_filter_func_line_unexpected_error(mock_sub, streaming_process, capsys):
"""If a filter function fails, the error is caught and logged."""

# Define a filter function that redacts lines that end with 1
# The newline is *not* included.
def filter_func(line):
Expand Down

0 comments on commit bc68cf4

Please sign in to comment.