Skip to content

Commit

Permalink
Version 3.21rc0
Browse files Browse the repository at this point in the history
  • Loading branch information
mborsetti committed Apr 16, 2024
1 parent 4e4e7ef commit 8e86ac9
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 15 deletions.
10 changes: 5 additions & 5 deletions docs/advanced.rst
Expand Up @@ -211,7 +211,8 @@ line-based difference, use GNU ``wdiff``:
.. code-block:: yaml
url: https://example.com/
diff_tool: wdiff
differ:
command: wdiff
In order for this to work, ``wdiff`` needs to be installed separately (e.g. ``apt install wdiff`` on Debian/Ubuntu,
``brew install wdiff`` on macOS, or download from `here <https://www.di-mgt.com.au/wdiff-for-windows.html>`__ for
Expand All @@ -221,18 +222,17 @@ You can more finely control the output of ``wdiff`` with command line arguments;
(or a generic one `here <https://www.gnu.org/software/wdiff/manual/>`__) for more information.

.. hint::
If you use an ``html`` report with ``diff_tool: wdiff``, the output of ``wdiff`` will be colorized.
If you use an ``html`` report with a ``command: wdiff`` differ, the output of ``wdiff`` will be colorized.

Alternatively you can use `PanDiff <https://github.com/davidar/pandiff>`__ to get markdown differences.

.. code-block:: yaml
url: https://example.com/
diff_tool: pandiff
differ:
command: pandiff
is_markdown: true
Note: the use of an external differ will override the ``diff`` setting of the ``html`` report.

Creating a separate notification for each change
------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions docs/differs.rst
Expand Up @@ -292,8 +292,8 @@ Example:
differ:
command: wdiff
Please see warning :ref:`important_note_for_command_jobs` for the file security settings required to run jobs with
this differ in Linux.
Please see :ref:`important note <important_note_for_command_jobs>` for the file security settings required to run jobs
with this differ in Linux.

.. versionchanged:: 3.21
Was previously a job sub-directive by the name of ``diff_tool``.
Expand Down
4 changes: 2 additions & 2 deletions docs/jobs.rst
Expand Up @@ -824,8 +824,8 @@ in a folder, output of scripts that query external devices (RPi GPIO), and many
.. _important_note_for_command_jobs:

.. important:: On Linux and macOS systems, due to security reasons a ``command`` job or a job with ``diff_tool`` will
not run unless **both** the jobs file **and** the directory it is located in are **owned** and **writeable** by
.. important:: On Linux and macOS systems, due to security reasons, a ``command`` job or a job with a ``command`` differ
will not run unless **both** the jobs file **and** the directory it is located in are **owned** and **writeable** by
**only** the user who is running the job (and not by its group or by other users). To set this up:

.. code-block:: bash
Expand Down
2 changes: 1 addition & 1 deletion docs/reporters.rst
Expand Up @@ -93,7 +93,7 @@ Time zone (global setting)
You can set the timezone for reports by entering a `IANA time zone name
<https://en.wikipedia.org/wiki/List_of_tz_database_time_zones>`__ in the ``tz`` directive of the ``report`` section.
This is useful if for example you are running :program:`webchanges` on a cloud server on a different timezone (e.g.
UTC). Note that this directive is ignored by the ``diff_tool`` job directive.
UTC). Note that this directive is ignored by any outside differs called by the :ref:``command_diff`` differ.

.. code-block:: yaml
Expand Down
5 changes: 3 additions & 2 deletions tests/data/jobs-is_shell_job.yaml
Expand Up @@ -6,9 +6,10 @@ url: job2
filter:
- shellpipe: anything
---
name: This job is a shelljob (diff_tool)
name: This job is a shelljob (differ command)
url: job3
diff_tool: anything
differ:
command: anything
---
name: This job is *not* a shelljob
url: job4
3 changes: 2 additions & 1 deletion webchanges/differs.py
Expand Up @@ -1203,6 +1203,7 @@ def _send_to_model(model_prompt: str) -> str:
mark_to_html(summary, extras={'tables'}).replace('<h2>', '<h3>').replace('</h2>', '</h3>')
+ '<br>'
+ unified_report['html']
+ f'---<i><small>{footer}</small></i>'
+ '-----<br>'
+ f'<i><small>{footer}</small></i>'
),
}
7 changes: 5 additions & 2 deletions webchanges/jobs.py
Expand Up @@ -450,12 +450,15 @@ def with_defaults(self, config: _Config) -> JobBase:
'command': {'command': job_with_defaults.diff_tool} # type: ignore[assignment]
}
warnings.warn(
f"Job {job_with_defaults.index_number}'diff_tool' is a deprecated job directive. Please use"
f"Job {job_with_defaults.index_number}: 'diff_tool' is a deprecated job directive. Please use"
f" differ '{{'command': {job_with_defaults.diff_tool}}}' instead.",
DeprecationWarning,
)
elif job_with_defaults.diff_tool is not None:
raise ValueError("'diff_tool' is a deprecated job directive. Please use 'differ' 'command:' instead.")
raise ValueError(
f"Job {job_with_defaults.index_number}: 'diff_tool' is a deprecated job directive. Please use "
'differ command instead.'
)

rep_cfg = config.get('report')
if isinstance(rep_cfg, dict):
Expand Down

0 comments on commit 8e86ac9

Please sign in to comment.