diff --git a/.github/workflows/pre-commit-update.yml b/.github/workflows/pre-commit-update.yml new file mode 100644 index 000000000..2a8038c23 --- /dev/null +++ b/.github/workflows/pre-commit-update.yml @@ -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 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ffa059d74..9dc090127 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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] diff --git a/changes/1070.misc.rst b/changes/1070.misc.rst new file mode 100644 index 000000000..6b137cfc8 --- /dev/null +++ b/changes/1070.misc.rst @@ -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. diff --git a/src/briefcase/platforms/web/static.py b/src/briefcase/platforms/web/static.py index 29c79e5f2..f166b56f0 100644 --- a/src/briefcase/platforms/web/static.py +++ b/src/briefcase/platforms/web/static.py @@ -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))}" diff --git a/tests/commands/run/test_LogFilter.py b/tests/commands/run/test_LogFilter.py index 9dabb0895..869881a54 100644 --- a/tests/commands/run/test_LogFilter.py +++ b/tests/commands/run/test_LogFilter.py @@ -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): @@ -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): @@ -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): diff --git a/tests/integrations/subprocess/test_Subprocess__stream_output.py b/tests/integrations/subprocess/test_Subprocess__stream_output.py index 31ae99b18..911701c3f 100644 --- a/tests/integrations/subprocess/test_Subprocess__stream_output.py +++ b/tests/integrations/subprocess/test_Subprocess__stream_output.py @@ -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") @@ -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: @@ -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): @@ -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): @@ -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): @@ -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. @@ -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):