Skip to content

Commit

Permalink
Merge pull request #2895 from c71n93/2894-fix-md-linter-errors
Browse files Browse the repository at this point in the history
Fix markdown linter errors
  • Loading branch information
yegor256 authored Feb 27, 2024
2 parents 8090e4b + 0ca0f5f commit 48f3ed9
Show file tree
Hide file tree
Showing 13 changed files with 153 additions and 80 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/markdown-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ on:
push:
branches:
- master
pull_request:
branches:
- master
paths-ignore: [ 'paper/**', 'sandbox/**' ]
concurrency:
group: markdown-lint-${{ github.ref }}
cancel-in-progress: true
Expand Down
16 changes: 16 additions & 0 deletions .markdownlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Default state for all rules
default: true

# Line length : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md013.md
MD013:
line_length: 100

# Inline HTML : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md033.md
MD033:
allowed_elements: [img]

# Fenced code blocks should have a language specified : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md040.md
MD040: false

# First line in a file should be a top-level heading : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md041.md
MD041: false
8 changes: 4 additions & 4 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,12 @@ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.0, available
[https://www.contributor-covenant.org/version/2/0/code_of_conduct.html](here).

Community Impact Guidelines were inspired by
Community Impact Guidelines were inspired by
[Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).

[homepage]: https://www.contributor-covenant.org

For answers to common questions about this code of conduct, see the
[FAQ](https://www.contributor-covenant.org/faq).
Translations are available
For answers to common questions about this code of conduct, see the
[FAQ](https://www.contributor-covenant.org/faq).
Translations are available
[https://www.contributor-covenant.org/translations](here).
46 changes: 24 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,26 +32,26 @@ they are good enough, including:
[C#](https://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29).
All of them have something **we don't tolerate**:

* types ([why?](https://www.yegor256.com/2020/11/10/typing-without-types.html))
* static/class methods or attributes ([why?](http://www.yegor256.com/2014/05/05/oop-alternative-to-utility-classes.html))
* classes ([why?](http://www.yegor256.com/2016/09/20/oop-without-classes.html))
* implementation inheritance ([why?](http://www.yegor256.com/2016/09/13/inheritance-is-procedural.html))
* mutability ([why?](http://www.yegor256.com/2014/06/09/objects-should-be-immutable.html) and [why not?](https://www.yegor256.com/2016/09/07/gradients-of-immutability.html))
* NULL ([why?](http://www.yegor256.com/2014/05/13/why-null-is-bad.html))
* global scope ([why?](https://www.yegor256.com/2018/07/03/global-variables.html))
* type casting ([why?](http://www.yegor256.com/2015/04/02/class-casting-is-anti-pattern.html))
* reflection ([why?](https://www.yegor256.com/2022/06/05/reflection-means-hidden-coupling.html))
* scalar types and data primitives
* annotations ([why?](http://www.yegor256.com/2016/04/12/java-annotations-are-evil.html))
* operators
* traits and mixins ([why?](https://www.yegor256.com/2017/03/07/traits-and-mixins.html))
* flow control statements (`for`, `while`, `if`, etc)
* [syntactic sugar](https://en.wikipedia.org/wiki/Syntactic_sugar) ([why?](https://github.com/objectionary/eo/issues/51))
* types ([why?](https://www.yegor256.com/2020/11/10/typing-without-types.html))
* static/class methods or attributes ([why?](http://www.yegor256.com/2014/05/05/oop-alternative-to-utility-classes.html))
* classes ([why?](http://www.yegor256.com/2016/09/20/oop-without-classes.html))
* implementation inheritance ([why?](http://www.yegor256.com/2016/09/13/inheritance-is-procedural.html))
* mutability ([why?](http://www.yegor256.com/2014/06/09/objects-should-be-immutable.html) and [why not?](https://www.yegor256.com/2016/09/07/gradients-of-immutability.html))
* NULL ([why?](http://www.yegor256.com/2014/05/13/why-null-is-bad.html))
* global scope ([why?](https://www.yegor256.com/2018/07/03/global-variables.html))
* type casting ([why?](http://www.yegor256.com/2015/04/02/class-casting-is-anti-pattern.html))
* reflection ([why?](https://www.yegor256.com/2022/06/05/reflection-means-hidden-coupling.html))
* scalar types and data primitives
* annotations ([why?](http://www.yegor256.com/2016/04/12/java-annotations-are-evil.html))
* operators
* traits and mixins ([why?](https://www.yegor256.com/2017/03/07/traits-and-mixins.html))
* flow control statements (`for`, `while`, `if`, etc)
* [syntactic sugar](https://en.wikipedia.org/wiki/Syntactic_sugar) ([why?](https://github.com/objectionary/eo/issues/51))

## Quick Start

First, install [Java SE](https://www.oracle.com/java/technologies/downloads/),
[npm](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm),
[npm](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm),
[Rust with Cargo](https://doc.rust-lang.org/cargo/getting-started/installation.html)
and [eoc](https://github.com/objectionary/eoc).

Expand All @@ -66,13 +66,13 @@ Then, start with a simple EO program in `app.eo` file:
Compile it like this (may take a minute or so):

```
$ eoc link
eoc link
```

Then, run it:

```
$ eoc --alone dataize app
eoc --alone dataize app
```

You should see "Hello, world!" printed.
Expand Down Expand Up @@ -189,8 +189,8 @@ This is the [EBNF](https://en.wikipedia.org/wiki/Extended_Backus%E2%80%93Naur_fo

<img alt="ENBF of 𝜑-calculus" src="https://www.eolang.org/ebnf/Phi.png" width="100%" />

The images were [auto-generated](https://github.com/objectionary/eo/actions/workflows/ebnf.yml).
It's better to use [ebnf/Eo.svg](https://www.eolang.org/ebnf/Eo.svg)
The images were [auto-generated](https://github.com/objectionary/eo/actions/workflows/ebnf.yml).
It's better to use [ebnf/Eo.svg](https://www.eolang.org/ebnf/Eo.svg)
and [ebnf/Phi.svg](https://www.eolang.org/ebnf/Phi.svg).

## What's Next?
Expand All @@ -202,7 +202,8 @@ Watch [video](https://www.youtube.com/watch?v=QaKIw1Bh3Oc) about EOLANG basics.
Read [our blog](https://news.eolang.org), especially the section with
[recently published papers](https://news.eolang.org/papers.html).

Learn [XMIR](https://news.eolang.org/2022-11-25-xmir-guide.html), a dialect of XML, which we use to represent EO program.
Learn [XMIR](https://news.eolang.org/2022-11-25-xmir-guide.html), a dialect of XML, which we use to
represent EO program.

See the full collection of canonical objects: [objectionary](https://github.com/objectionary/home).

Expand All @@ -222,12 +223,13 @@ provided they don't violate our quality standards. To avoid frustration,
before sending us your pull request please run full Maven build:

```bash
$ mvn clean install -Pqulice
mvn clean install -Pqulice
```

You will need [Maven 3.3+](https://maven.apache.org) and Java 8+ installed.

## Special thanks

We are using the [YourKit Java Profiler](https://www.yourkit.com/java/profiler)
to enhance the performance of EO components:

Expand Down
29 changes: 17 additions & 12 deletions eo-maven-plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,15 @@ The entire process of turning an `.eo` program into an executable
binary code consists of a few high-level steps, which must be done
one after another:

* **Parsing**.
* **Parsing**.
It's done by the `org.eolang.parser.EoSyntax` class in the `eo-parser` module. It takes
the source code in a plain text format and parses into XML document,
using [ANTLR4](https://www.antlr.org/) and [Xembly](https://www.xembly.org).
The output of the parser you can find in the `target/eo/parse` directory.
Parsed objects which are versioned (normally pulled from
[Objectionary](https://github.com/objectionary/home)) are cached in `.eo/parsed` folder.
Parsed objects which are versioned (normally pulled from
[Objectionary](https://github.com/objectionary/home)) are cached in `.eo/parsed` folder.

* **Optimization**.
* **Optimization**.
There are a number of [XSL transformations](https://en.wikipedia.org/wiki/XSLT)
that need to be done
with the XML document in order to make it ready for compilation.
Expand All @@ -99,7 +99,7 @@ one after another:
`org.eolang.parser.Pack` class. Some of XLST files are sanity checks (or linters).
The output of each transformation you can find in the `target/eo/optimize` directory.

* **Compilation**.
* **Compilation**.
The class `org.eolang.maven.TranspileMojo` in the `eo-maven-plugin` module is responsible
for taking parsed and optimized XMIRs and then transforming
the XML document into a collection of `.java` files. There are a number
Expand All @@ -117,35 +117,40 @@ If any external object is used in EO program it will be pulled from [Objectionar
By default, during compilation the plugin will check local cache (`~/.eo`) for required objects
and only download (and cache) them in case they are not found locally.

This behaviour can be changed to always download objects from remote by providing
This behaviour can be changed to always download objects from remote by providing
Maven option `-U` (see [Maven CLI docs](https://maven.apache.org/ref/3.1.0/maven-embedder/cli.html)):

```shell
mvn -U clean install
```

If you want to build your project or run your tests which use eo-maven-plugin, you can change stack size for your purposes by stack-size option:
If you want to build your project or run your tests which use eo-maven-plugin, you can change stack
size for your purposes by stack-size option:

```shell
mvn clean install -Pqulice -Dstack-size=1M
```

where 1M is size of stack. By default stack-size = 256M in eo-maven-plugin, maximum size is 1G.

## How to run Integration Tests only

If you want to run a specific integration test without waiting until other unit or integration tests are executed you need to go to `eo-maven-plugin`
directory and execute the next command:
If you want to run a specific integration test without waiting until other unit or integration tests
are executed you need to go to `eo-maven-plugin` directory and execute the next command:

```shell
mvn clean integration-test invoker:run -Dinvoker.test=fibonacci -DskipTests
```

Here `fibonacci` is the name of the desired integration test, `-DskipTests` is used in order to skip `eo-maven-plugin` unit tests.
Here `fibonacci` is the name of the desired integration test, `-DskipTests` is used in order to skip
`eo-maven-plugin` unit tests.

## How to disable Integration Tests

It is sometime necessary to temporary disable the integration tests (for example for introducing braking changes into plugin or EO runtime).
This can be achieved by disabling `maven-invoker-plugin` execution within `eo-maven-plugin/pom.xml`:
It is sometime necessary to temporary disable the integration tests (for example for introducing
braking changes into plugin or EO runtime). This can be achieved by disabling `maven-invoker-plugin`
execution within `eo-maven-plugin/pom.xml`:

```xml
<plugins>
...
Expand Down
5 changes: 3 additions & 2 deletions eo-maven-plugin/src/it/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<img src="https://www.yegor256.com/images/books/elegant-objects/cactus.svg" height="100px" />
<!-- markdownlint-disable-next-line line-length -->
<img alt="logo" src="https://www.yegor256.com/images/books/elegant-objects/cactus.svg" height="100px" />

[![Maven Central](https://img.shields.io/maven-central/v/org.eolang/eo-maven-plugin.svg)](https://maven-badges.herokuapp.com/maven-central/org.eolang/eo-maven-plugin)

This directory contains integration tests for eolang-maven-plugin,
but you can use them as examples of EO-to-Java transformations.
but you can use them as examples of EO-to-Java transformations.
2 changes: 1 addition & 1 deletion eo-maven-plugin/src/it/duplicate_classes/README.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<img alt="logo" src="https://www.objectionary.com/cactus.svg" height="100px" />
<img alt="logo" src="https://www.objectionary.com/cactus.svg" height="100px" />
2 changes: 1 addition & 1 deletion eo-maven-plugin/src/it/hash_package_layer/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<img alt="logo" src="https://www.objectionary.com/cactus.svg" height="100px" />

This test checks if one more package layer is added successfully to all source files.
This test checks if one more package layer is added successfully to all source files.
2 changes: 1 addition & 1 deletion eo-maven-plugin/src/it/rewritten_sources/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<img alt="logo" src="https://www.objectionary.com/cactus.svg" height="100px" />

The main goal of the integration test is to check that `mvn test-compile` step does not rewrite
files in `target/classes` which were generated from `src` folder.
files in `target/classes` which were generated from `src` folder.
2 changes: 1 addition & 1 deletion eo-maven-plugin/src/it/simple/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
This is the simplest possible example of a program written in EO.
Don't make it more complex than it is right now.
The purpose of this integration test is to keep it running no matter
how much we change the eo-maven-plugin or the eo-runtime modules.
how much we change the eo-maven-plugin or the eo-runtime modules.
Loading

0 comments on commit 48f3ed9

Please sign in to comment.