Skip to content

Commit

Permalink
Add Markdown Lint and README.md formatting (#187)
Browse files Browse the repository at this point in the history
This commit includes adding `Markdown Lint` to the GitHub workflow. This
will help in maintaining consistent formatting and code quality in
markdown files.

Updates were also made to enhance code readability by improving the
structure and formatting in the YAML scripts, PHP test files, and the
markdown readme file.

Moreover, a new `.editorconfig` file was added to manage markdown files
and `.markdownlint.yml` file was added to configure the linter.

Lastly, `Makefile` was updated to include commands for running markdown
tests.
  • Loading branch information
SmetDenis committed Apr 25, 2024
1 parent 8d8f3e4 commit e79986b
Show file tree
Hide file tree
Showing 6 changed files with 196 additions and 119 deletions.
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,12 @@ trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 4

[*.md]
max_line_length = 150

[Makfile]
indent_style = tab

[{*yml,*yaml}]
indent_size = 2
14 changes: 14 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,20 @@ jobs:
run: make codestyle --no-print-directory


markdown-lint:
name: Markdown Lint
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: 👍 Markdown Lint
uses: articulate/actions-markdownlint@v1
with:
config: .markdownlint.yml
files: '*.md'


verify-php-binary:
name: Verify PHP binary
runs-on: ubuntu-latest
Expand Down
37 changes: 37 additions & 0 deletions .markdownlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#
# JBZoo Toolbox - Csv-Blueprint.
#
# This file is part of the JBZoo Toolbox project.
# For the full copyright and license information, please view the LICENSE
# file that was distributed with this source code.
#
# @license MIT
# @copyright Copyright (C) JBZoo.com, All rights reserved.
# @see https://github.com/JBZoo/Csv-Blueprint
#

# See https://github.com/DavidAnson/markdownlint/tree/main/doc

MD043: false

MD033:
allowed_elements:
- summary
- details
- table
- tr
- td
- b
- br

MD012:
maximum: 2

MD013:
line_length: 150
heading_line_length: 120
code_blocks: false
tables: false
headings: true
strict: false
stern: false
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -156,3 +156,8 @@ bench-phar: ##@Benchmarks Run CSV file with Phar
bench-php: ##@Benchmarks Run CSV file with classic PHP binary
$(PHP_BIN) ./csv-blueprint --ansi --version
-$(BLUEPRINT) $(BENCH_CSV) $(BENCH_SCHEMAS) $(BENCH_FLAGS)

# Extrat tests #########################################################################################################
test-md: ##@Tests Run Markdown tests
$(call title,"Markdown lint")
@markdownlint --config .markdownlint.yml *.md

0 comments on commit e79986b

Please sign in to comment.