Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
cmhughes committed Sep 23, 2023
2 parents c66b1aa + c565c00 commit 098808b
Show file tree
Hide file tree
Showing 46 changed files with 373 additions and 135 deletions.
17 changes: 13 additions & 4 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,24 @@
# 1. keep *github actions* files up to date
# 2. keep *docker* related files up to date
#
# reference
# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
#
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
target-branch: "develop"
schedule:
interval: "weekly"
day: "sunday"
time: "06:00"
timezone: "Europe/London"
- package-ecosystem: "docker"
directory: "/"
schedule:
interval: "monthly"
target-branch: "develop"
schedule:
interval: "weekly"
day: "sunday"
time: "06:00"
timezone: "Europe/London"
6 changes: 3 additions & 3 deletions .github/workflows/batch-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ jobs:
anychanged: ${{ steps.changed-files.outputs.any_changed }}
steps:
- name: Loading the "base actions/checkout" so as to access latexindent.pl
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Check for changed pm files, latexindent.pl, defaultSettings.yaml
uses: tj-actions/changed-files@v38
uses: tj-actions/changed-files@v39
id: changed-files
with:
files: |
Expand Down Expand Up @@ -87,7 +87,7 @@ jobs:
#
# https://github.com/actions/checkout
- name: Loading the "base actions/checkout" so as to access latexindent.pl
uses: actions/checkout@v3
uses: actions/checkout@v4
# install Perl
#
# https://github.com/marketplace/actions/setup-perl-environment
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/build-documentation-and-executables.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: load the "base actions/checkout" so as to access latexindent.pl
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: installing texlive full
uses: xu-cheng/texlive-action/full@v1
with:
Expand Down Expand Up @@ -69,7 +69,7 @@ jobs:
# https://github.com/actions/checkout
#
- name: load the "base actions/checkout" so as to access latexindent.pl
uses: actions/checkout@v3
uses: actions/checkout@v4
#
# https://github.com/marketplace/actions/setup-perl-environment
#
Expand Down Expand Up @@ -130,7 +130,7 @@ jobs:
# https://github.com/actions/checkout
#
- name: load the "base actions/checkout" so as to access latexindent.pl
uses: actions/checkout@v3
uses: actions/checkout@v4
#
# https://github.com/marketplace/actions/setup-perl-environment
#
Expand Down Expand Up @@ -189,7 +189,7 @@ jobs:
# https://github.com/actions/checkout
#
- name: load the "base actions/checkout" so as to access latexindent.pl
uses: actions/checkout@v3
uses: actions/checkout@v4
#
# https://github.com/marketplace/actions/setup-perl-environment
#
Expand Down Expand Up @@ -245,7 +245,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Loading the "base actions/checkout" so as to access the repository latexindent.pl
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: copy source files from repository into temporary folder
run: |
mkdir latexindent
Expand Down Expand Up @@ -328,7 +328,7 @@ jobs:
needs: [zip-files]
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
#
# download artifacts
#
Expand Down Expand Up @@ -385,7 +385,7 @@ jobs:
echo "version=$(echo ${{ github.ref }}|cut -d'/' -f 3)" >> $GITHUB_OUTPUT
echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
- name: Loading the "base actions/checkout" so as to access the repository latexindent.pl
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: get latexindent announcement text from changelog.md
id: announcement
run: |
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release-docker-ghcr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ jobs:
latexindent-ghcr:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: docker/setup-buildx-action@v2
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
id: buildx
with:
install: true
Expand All @@ -29,14 +29,14 @@ jobs:
images: ghcr.io/${{ github.repository }}
tags: |
type=match,pattern=V(.*),group=1
- uses: docker/login-action@v2
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: get latexindent tag
run: echo "TAG=${GITHUB_REF##*/}" >> $GITHUB_ENV
- uses: docker/build-push-action@v4
- uses: docker/build-push-action@v5
with:
context: .
push: true
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/test-cases-on-pull.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ jobs:
outputs:
anychanged: ${{ steps.changed-files.outputs.any_changed }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get changed files, latexindent.pl
id: changed-files
uses: tj-actions/changed-files@v38
uses: tj-actions/changed-files@v39
with:
use_fork_point: "true"
files: |
Expand Down Expand Up @@ -79,7 +79,7 @@ jobs:
#
# https://github.com/actions/checkout
- name: Loading the "base actions/checkout" so as to access latexindent.pl
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: run test-cases/test-cases.sh
shell: bash
run: |
Expand All @@ -92,7 +92,7 @@ jobs:
sed -i.bak "s/checkgitdiff//" test-cases.sh
./test-cases.sh -s
- name: Check for changed files in test-cases
uses: tj-actions/changed-files@v38
uses: tj-actions/changed-files@v39
id: changed-files
with:
files: |
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ FROM perl:5.38.0-slim-threaded-buster
#

ARG LATEXINDENT_VERSION
ENV LATEXINDENT_VERSION ${LATEXINDENT_VERSION:-V3.23.1}
ENV LATEXINDENT_VERSION ${LATEXINDENT_VERSION:-V3.23.2}

RUN apt-get update \
&& apt-get install \
Expand Down
27 changes: 17 additions & 10 deletions LatexIndent/Special.pm
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,23 @@ sub construct_special_begin {
next;
}

# body of specialBeginEnd
my $specialBodyRegEx = q();
if ( defined ${$BeginEnd}{body} ) {
$specialBodyRegEx = qr/${$BeginEnd}{body}/;
}
else {
$specialBodyRegEx = qr/(?: # cluster-only (), don't capture
(?!
(?:$specialBegins) # cluster-only (), don't capture
). # any character, but not anything in $specialBegins
)*?/sx;
}

# the overall regexp
$specialAllMatchesRegExp .= ( $specialAllMatchesRegExp eq "" ? q() : "|" ) . qr/
${$BeginEnd}{begin}
(?: # cluster-only (), don't capture
(?!
(?:$specialBegins) # cluster-only (), don't capture
). # any character, but not anything in $specialBegins
)*?
$specialBodyRegEx
${$BeginEnd}{end}
/sx;

Expand All @@ -90,11 +99,7 @@ sub construct_special_begin {
(\R*)?
)
(
(?: # cluster-only (), don't capture
(?!
(?:$specialBegins) # cluster-only (), don't capture
). # any character, but not anything in $specialBegins
)*?
$specialBodyRegEx
(\R*)?
)
(
Expand Down Expand Up @@ -252,6 +257,8 @@ sub tasks_particular_to_each_object {

}

$self->find_special;

return unless ( ${ $mainSettings{specialBeginEnd} }{specialBeforeCommand} );

# lookForAlignDelims: lookForChildCodeBlocks set to 0 means no child objects searched for
Expand Down
4 changes: 2 additions & 2 deletions LatexIndent/Version.pm
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ use warnings;
use Exporter qw/import/;
our @EXPORT_OK = qw/$versionNumber $versionDate/;

our $versionNumber = '3.23.1';
our $versionDate = '2023-09-13';
our $versionNumber = '3.23.2';
our $versionDate = '2023-09-23';
1
9 changes: 5 additions & 4 deletions defaultSettings.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# latexindent.pl, version 3.23.1, 2023-09-13
# latexindent.pl, version 3.23.2, 2023-09-23
#
# defaultSettings.yaml, the default settings for latexindent.pl
#
Expand Down Expand Up @@ -258,15 +258,16 @@ itemNames:
specialBeginEnd:
displayMath:
begin: (?<!\\)\\\[ # \[ but *not* \\[
end: \\\] # \]
end: \\\] # \]
lookForThis: 1
inlineMath:
begin: (?<!\$)(?<!\\)\$(?!\$) # $ but *not* \$ or $$
end: (?<!\\)\$(?!\$) # $ but *not* \$ or $$
body: [^$]*? # anything *except* $
end: (?<!\\)\$(?!\$) # $ but *not* \$ or $$
lookForThis: 1
displayMathTeX:
begin: \$\$ # $$
end: \$\$ # $$
end: \$\$ # $$
lookForThis: 1
specialBeforeCommand: 0

Expand Down
4 changes: 3 additions & 1 deletion documentation/changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<!-- announcement: minor bugfix for text wrap-->
<!-- announcement: minor bugfix for specialBeginEnd-->

# changelog.md
## V3.23.2, September 23, 2023
bugfix for `specialBeginEnd', see [issue-477](https://github.com/cmhughes/latexindent.pl/issues/477)

## V3.23.1, September 13, 2023
minor bugfix for text wrap routine, see [issue-471](https://github.com/cmhughes/latexindent.pl/issues/471)
Expand Down
4 changes: 2 additions & 2 deletions documentation/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@
# built documents.
#
# The short X.Y version.
version = u'3.23.1'
version = u'3.23.2'
# The full version, including alpha/beta/rc tags.
release = u'3.23.1'
release = u'3.23.2'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
3 changes: 3 additions & 0 deletions documentation/demonstrations/documentation-test-cases.sh
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,9 @@ latexindent.pl -s specialLR.tex -l specialsLeftRight.yaml,specialBeforeCommand.y
latexindent.pl -s special-align.tex -l edge-node1.yaml -o=+-mod1
latexindent.pl -s special-align.tex -l edge-node2.yaml -o=+-mod2

# specialBeginEnd body demonstration
latexindent.pl -s special-body.tex -l special-body1.yaml -o=+-mod1

# one sentence per line
latexindent.pl -s multiple-sentences -m -l=manipulate-sentences.yaml -o=+-mod1
latexindent.pl -s multiple-sentences -m -l=keep-sen-line-breaks.yaml -o=+-mod2
Expand Down
2 changes: 1 addition & 1 deletion documentation/demonstrations/pre-commit-config-conda.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
- repo: https://github.com/cmhughes/latexindent.pl
rev: V3.23.1
rev: V3.23.2
hooks:
- id: latexindent-conda
args: [-s]
2 changes: 1 addition & 1 deletion documentation/demonstrations/pre-commit-config-cpan.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
- repo: https://github.com/cmhughes/latexindent.pl
rev: V3.23.1
rev: V3.23.2
hooks:
- id: latexindent
args: [-s]
2 changes: 1 addition & 1 deletion documentation/demonstrations/pre-commit-config-demo.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
- repo: https://github.com/cmhughes/latexindent.pl
rev: V3.23.1
rev: V3.23.2
hooks:
- id: latexindent
args: [-l, -m, -s, -w]
2 changes: 1 addition & 1 deletion documentation/demonstrations/pre-commit-config-docker.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
- repo: https://github.com/cmhughes/latexindent.pl
rev: V3.23.1
rev: V3.23.2
hooks:
- id: latexindent-docker
args: [-s]
17 changes: 17 additions & 0 deletions documentation/demonstrations/special-body-mod1.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
$
a
+
(
b + c
-
(
d
)
)
=
e
$
and
$
f + g = h
$
17 changes: 17 additions & 0 deletions documentation/demonstrations/special-body-mod2.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
$
a
+
(
b + c
-
(
d
)
)
=
e
$
and
$
f + g = h
$
17 changes: 17 additions & 0 deletions documentation/demonstrations/special-body.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
$
a
+
(
b + c
-
(
d
)
)
=
e
$
and
$
f + g = h
$
6 changes: 6 additions & 0 deletions documentation/demonstrations/special-body1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
defaultIndent: " "
specialBeginEnd:
specialBeforeCommand: 1
parentheses:
begin: \(
end: \)

0 comments on commit 098808b

Please sign in to comment.