Skip to content

Commit

Permalink
Markdown lint
Browse files Browse the repository at this point in the history
  • Loading branch information
StevenLooman committed Jul 31, 2023
1 parent ecf1530 commit 85bb80e
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 41 deletions.
14 changes: 11 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build
name: Lint, build and test
on:
push:
branches:
Expand All @@ -10,8 +10,8 @@ jobs:
build:
name: Build and test
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
matrix:
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
Expand All @@ -38,3 +38,11 @@ jobs:
with:
name: Package
path: staging

markdown_lint:
name: Markdown Lint
runs-on: ubuntu-latest
steps:
- uses: DavidAnson/markdownlint-cli2-action@v11
with:
globs: '**/*.md'
3 changes: 1 addition & 2 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
Changes
=======
# Changes

0.7.2 (unreleased)

Expand Down
53 changes: 17 additions & 36 deletions magik-lint/README.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,25 @@
Magik-Lint
==========
# Magik-Lint

A command line linter to use in your workflow. Mostly built after [Pylint](https://www.pylint.org/).


Features
--------

Magik-lint currently features:

- Checks to help you improve your code quality
- Checks to help you prevent introduce bugs
- Style checking


Usage
-----
## Usage

Magik-lint takes the following command line options:

- --rcfile: Path to configuration file
- --msg-template: Template for output, defaults to: `${path}:${line}:${column}: ${msg} (${symbol})`
- --show-checks: Show a list of all checks and whether it is disabled
- `--rcfile`: Path to configuration file
- `--msg-template`: Template for output, defaults to: `${path}:${line}:${column}: ${msg} (${symbol})`
- `--show-checks`: Show a list of all checks and whether it is disabled
- A file or directory to check.
- If a file is given, only this file is checked.
- If a directory is given, all files in this directory and any sub-directories, are checked.


Integration
-----------
## Integration

The [emacs magik-mode](https://github.com/roadrunner1776/magik) readily supports integration of magik-tools through [flycheck](https://www.flycheck.org/).

VSCode integration is achieved by adding a task with a `problemMatcher`, for example:
```

```json
{
"label": "magik-lint",
"type": "shell",
Expand All @@ -54,15 +40,13 @@ VSCode integration is achieved by adding a task with a `problemMatcher`, for exa
}
```


Configuration
-------------
## Configuration

Magik-lint can use a configuration file.

The configuration file is located as follows, in order:

1. if `--rcfile`` command line argument is given, use it;
1. if `--rcfile` command line argument is given, use it;
2. if `magik-lint.properties` exists in the current working directory, use it;
3. if `.magik-lint.properties` exists in the current working directory, use it;
4. if `magik-lint.properties` exists in the current Smallworld product seen from the current working directory, or any parent product, use it;
Expand All @@ -74,24 +58,23 @@ If no configuration file is found, defaults are assumed.

The following options are avaiable in the configuration file:

- enabled = <comma separated list of check-names>
- disabled = <comma separated list of check-names or `all`>
- <check_name>.<check_attribute> = <value>
- enabled = \<comma separated list of check-names\>
- disabled = \<comma separated list of check-names or `all`\>
- \<check_name\>.\<check_attribute\> = \<value\>

I.e., you can disable checks `method-complexity` and `line-length` by setting:

```
```text
disabled = method-complexity, line-length
```

You can configure the `line-length` check to allow up to 120 characters per line by settings:

```
```text
line-length.line-length=120
```

Exit codes
----------
## Exit codes

The exit code from Magik-lint is determined by the infractions of checks. The severity of a check will set a flag in the return code:

Expand All @@ -101,8 +84,6 @@ The exit code from Magik-lint is determined by the infractions of checks. The se

When using Git, checking flags in the return code allows you to allow minor infractions being committed, but prevent a commit of a major infraction, using Git hooks.


Template rules
--------------
## Template rules

XXX TODO

0 comments on commit 85bb80e

Please sign in to comment.