Skip to content

Commit

Permalink
Merge pull request #478 from Witiko/feat/enforce-line-length
Browse files Browse the repository at this point in the history
Ensure that all code lines are shorter than 72 characters
  • Loading branch information
Witiko authored Aug 13, 2024
2 parents d44aaf9 + 2b50a38 commit a326478
Show file tree
Hide file tree
Showing 6 changed files with 1,807 additions and 1,212 deletions.
17 changes: 15 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,20 @@ jobs:
repository: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name || github.repository }}
ref: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.sha || github.sha }}
- name: Check for tabs and trailing spaces
run: |
! grep -n -P '\t|\s+$' markdown.dtx
run: make check-tabs-and-spaces
linelength:
name: Style check (Line length)
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
repository: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name || github.repository }}
ref: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.sha || github.sha }}
- name: Extract scripts
run: make base
- name: Check the line length
run: make check-line-length
shellcheck:
name: Style check (Bash)
runs-on: ubuntu-latest
Expand Down Expand Up @@ -130,6 +142,7 @@ jobs:
name: Build Docker image
needs:
- spacecheck
- linelength
- shellcheck
- luacheck
- markdownlint
Expand Down
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ Deprecation:
Users should use `jekyllDataTypographicString` instead.
(istqborg/istqb_product_base#46, #440, #451, sponsored by @istqborg)

Continuous Integration:

- Ensure that all code lines are shorter than 72 characters. (#478)

Experiments:

- Measure the speed of the Markdown package across recent versions.
Expand Down
10 changes: 9 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.PHONY: all base clean implode dist test force \
docker-image docker-push-temporary-tag docker-print-temporary-tag \
docker-push-release-tag preview
docker-push-release-tag preview check-line-length

SHELL=/bin/bash

Expand Down Expand Up @@ -276,3 +276,11 @@ implode: clean
rm -f $(MAKEABLES) $(ARCHIVES)
$(MAKE) -C examples implode
$(MAKE) -C libraries implode

# This pseudo-target checks that the length of lines in the source files.
check-line-length: $(INSTALLABLES)
! grep -n -E '^.{73,}$$' $^

# This pseudo-target checks for tabs and trailing spaces in the source files.
check-tabs-and-spaces: $(DTXARCHIVE)
! grep -n -P '\t|\s+$$' $<
6 changes: 3 additions & 3 deletions docstrip.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
-- permit persons to whom the Software is furnished to do so, subject to^^J%
-- the following conditions:^^J%
--^^J%
-- The above copyright notice and this permission notice shall be included^^J%
-- in all copies or substantial portions of the Software.^^J%
-- The above copyright notice and this permission notice shall be^^J%
-- included in all copies or substantial portions of the Software.^^J%
--^^J%
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,^^J%
-- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF^^J%
-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.^^J%
-- MERCHANTABILITY, FITNESS FOR PARTICULAR PURPOSE AND NONINFRINGEMENT.^^J%
-- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY^^J%
-- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,^^J%
-- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE^^J%
Expand Down
Loading

0 comments on commit a326478

Please sign in to comment.