Skip to content

Commit

Permalink
Merge branch 'master' into 3058_all-atoms-are-public
Browse files Browse the repository at this point in the history
  • Loading branch information
levBagryansky committed Apr 27, 2024
2 parents 9eb8ad4 + 0c3f311 commit dbb8927
Show file tree
Hide file tree
Showing 27 changed files with 117 additions and 43 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/actionlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
name: actionlint
'on':
push:
branches:
- master
pull_request:
branches:
- master
jobs:
actionlint:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Download actionlint
id: get_actionlint
run: bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)
shell: bash
- name: Check workflow files
run: ${{ steps.get_actionlint.outputs.executable }} -color
shell: bash
2 changes: 1 addition & 1 deletion .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
codecov:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
- uses: actions/checkout@v4
- uses: teatimeguest/[email protected]
with:
update-all-packages: true
Expand Down
20 changes: 12 additions & 8 deletions .github/workflows/daily.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,27 @@ jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
- uses: actions/checkout@v4
- uses: teatimeguest/[email protected]
with:
update-all-packages: true
packages: scheme-basic geometry xcolor naive-ebnf microtype etoolbox
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 20
- uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-jdk-${{ matrix.java }}-maven-${{ hashFiles('**/pom.xml') }}
key: ${{ runner.os }}-jdk-20-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-jdk-${{ matrix.java }}-maven-
${{ runner.os }}-jdk-20-maven-
- run: |
# Clean the test classes to avoid caching issues and prepare testing environment
# without running the tests
mvn clean install -Pqulice -DskipTests -DskipITs -Dinvoker.skip=true
# Find script
SCRIPT="${GITHUB_WORKSPACE}/src/test/scripts/test-repetition.sh"
SCRIPT=${GITHUB_WORKSPACE}/src/test/scripts/test-repetition.sh
# Check that script is exists
if [ ! -f "${SCRIPT}" ]; then
echo "Script ${SCRIPT} not found"
Expand All @@ -33,15 +37,15 @@ jobs:
# Make script runnable
chmod +x "${SCRIPT}"
# Test eo-parser
${SCRIPT} --max 10 --folder ${GITHUB_WORKSPACE}/eo-parser
"${SCRIPT}" --max 10 --folder "${GITHUB_WORKSPACE}/eo-parser"
# Test eo-maven-plugin
${SCRIPT} --max 10 --folder ${GITHUB_WORKSPACE}/eo-maven-plugin
"${SCRIPT}" --max 10 --folder "${GITHUB_WORKSPACE}/eo-maven-plugin"
# Test eo-runtime
${SCRIPT} --max 10 --folder ${GITHUB_WORKSPACE}/eo-runtime --compilation true
"${SCRIPT}" --max 10 --folder "${GITHUB_WORKSPACE}/eo-runtime" --compilation true
report-fail:
name: Create issue on failure
needs: build
if: failure() && github.even.pull_request == null
if: failure() && github.event.pull_request == null
runs-on: ubuntu-22.04
steps:
- uses: jayqi/failed-build-issue-action@v1
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ebnf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
env:
CONVERT_PATH: /tmp/antlr4-to-bnf-converter
steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
- uses: actions/checkout@v4
- run: |
sudo apt-get update
sudo apt-get -y install ghostscript imagemagick texlive-extra-utils pdf2svg inkscape
Expand All @@ -28,8 +28,8 @@ jobs:
- uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-jdk-${{ matrix.java }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-jdk-${{ matrix.java }}-maven-
key: ${{ runner.os }}-jdk-20-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-jdk-20-maven-
- run: |
mkdir -p "$CONVERT_PATH"
wget --quiet http://public.yegor256.com/convert.zip -O /tmp/convert.zip
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gpt-code-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/loc-badge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
loc-badge:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
- uses: actions/checkout@v4
- uses: shadowmoose/[email protected]
with:
debug: true
Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/markdown-lint.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
---
name: markdown-lint
on:
'on':
push:
branches:
- master
pull_request:
branches:
- master
paths-ignore: [ 'paper/**', 'sandbox/**' ]
concurrency:
group: markdown-lint-${{ github.ref }}
cancel-in-progress: true
jobs:
markdown-lint:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@8459bc0c7e3759cdf591f513d9f141a95fef0a8f
- uses: actions/checkout@v4
- uses: articulate/actions-markdownlint@v1
8 changes: 3 additions & 5 deletions .github/workflows/simian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,10 @@ jobs:
simian:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
- run: |
wget --quiet http://public.yegor256.com/simian.jar -O /tmp/simian.jar
- run: |
java -jar /tmp/simian.jar -threshold=19 -excludes=**/gen -excludes=**/it **/*.java
- run: wget --quiet http://public.yegor256.com/simian.jar -O /tmp/simian.jar
- run: java -jar /tmp/simian.jar -threshold=19 "-excludes=**/gen" "-excludes=**/it" "**/*.java"
2 changes: 1 addition & 1 deletion .github/workflows/sonar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
sonar:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: teatimeguest/[email protected]
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/typos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---

name: typos
'on':
push:
branches:
- master
pull_request:
branches:
- master
jobs:
typos:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: crate-ci/typos@master
2 changes: 1 addition & 1 deletion .github/workflows/up.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
up:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
- uses: actions/checkout@v4
- run: |-
git fetch --tags --force && \
latest=$(git tag --sort=creatordate | tail -1) && \
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/xcop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
xcop:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
- uses: actions/checkout@v4
- uses: g4s8/[email protected]
with:
files: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/year.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
license:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: FantasticFiasco/action-update-license-year@v3
Expand Down
14 changes: 14 additions & 0 deletions _typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[default]
extend-ignore-identifiers-re = [
"Olt*", # false positive
"Onot", # false positive
"BA", # false positive
"thi", # false positive
"lowcase", # false positive
"[D,d]atas*", # valid variable names
"thr", # valid variable name
"cutted", # valid variable name
"splitted", # valid variable name
"scrpt", # valid variable name
"fle" # valid variable name
]
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ count, new Rel(this.phiInputDir), new Rel(this.phiOutputDir)

/**
* Translate given xmir to phi calculus expression.
* @param train Train that optimize and traslates given xmir
* @param train Train that optimize and translates given xmir
* @param xmir Text of xmir
* @return Translated xmir
* @throws ImpossibleToPhiTranslationException If fails to translate given XMIR to phi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@

import com.jcabi.log.Logger;
import org.cactoos.Text;
import org.cactoos.text.Sticky;

/**
* Hash of tag from objectionary.
Expand All @@ -37,7 +36,7 @@ public final class ChRemote implements CommitHash {
/**
* Cached text of hashes.
*/
private static final Text CACHE = new Sticky(new CommitHashesText());
private static final Text CACHE = new CommitHashesText();

/**
* Tag.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,15 @@
*/
package org.eolang.maven.hash;

import org.cactoos.Scalar;

/**
* Hash of tag.
*
* @since 0.28.11
*/
public interface CommitHash {
@FunctionalInterface
public interface CommitHash extends Scalar<String> {

/**
* SHA Hash.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ void printsInStraightNotation(final String pack, @TempDir final Path temp) throw
void printsInReversedNotation(final String pack, @TempDir final Path temp) throws Exception {
final Map<String, Object> yaml = new Yaml().load(pack);
MatcherAssert.assertThat(
"PrintMojo should print EO in reveresed notation, but it didn't",
"PrintMojo should print EO in reversed notation, but it didn't",
PrintMojoTest.printed(yaml, temp, true).asString(),
Matchers.equalTo((String) yaml.get("reversed"))
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ void failsOnWarning(@TempDir final Path temp) throws Exception {
/**
* Apply XSL transformation.
* @param xsl Path to XSL within classpath
* @param xml Path to XML to be tranformed
* @param xml Path to XML to be transformed
*/
private static void applyXsl(final String xsl, final Path xml) throws Exception {
final XML output = new Xsline(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
package org.eolang.maven.hash;

import com.yegor256.WeAreOnline;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import java.util.stream.StreamSupport;
import org.cactoos.experimental.Threads;
import org.eolang.maven.BinarizeParseTest;
import org.hamcrest.MatcherAssert;
import org.hamcrest.Matchers;
Expand Down Expand Up @@ -67,4 +71,22 @@ void throwsCommitHashException() {
BinarizeParseTest.TO_ADD_MESSAGE
);
}

@Test
void isThreadSafe() {
final int threads = 200;
final String sample = new ChRemote("0.23.19").value();
MatcherAssert.assertThat(
"You can use this class concurrently",
StreamSupport.stream(
new Threads<>(
threads,
Stream.generate(
() -> new ChRemote("0.23.19")
).limit(threads).collect(Collectors.toList())
).spliterator(), false
).filter(str -> !sample.equals(str)).collect(Collectors.toList()),
Matchers.empty()
);
}
}
6 changes: 3 additions & 3 deletions eo-parser/src/main/antlr4/org/eolang/parser/Eo.g4
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ vapplicationArgUnboundCurrent
vapplicationArgUnboundNext
: vapplicationArgVanonymUnbound // vertical anonym object
| vapplicationHeadNamed vapplicationArgs // vertical application
| reversed oname? vapplicationArgsReversed // reversed verical application
| reversed oname? vapplicationArgsReversed // reversed vertical application
;

// Horizontal application as argument of vertical application
Expand Down Expand Up @@ -351,7 +351,7 @@ onlyphiTail: spacedArrow attributes
;

// Inner object of horizontal anonym object
// Does not contan elements in vertical notation
// Does not contain elements in vertical notation
hanonymInner
: SPACE LB (hmethod | hmethodVersioned | happlication | hanonym | just) oname RB
;
Expand Down Expand Up @@ -390,7 +390,7 @@ hmethodExtended
// The whole method is written in one line
// The head does not contain elements in vertical notation
// The division of elements into regular and versioned ones is due to
// the presence of horizontal application where head or agruments can't
// the presence of horizontal application where head or arguments can't
// contain version
hmethodVersioned
: hmethodHead methodTail* methodTailVersioned
Expand Down
2 changes: 1 addition & 1 deletion eo-parser/src/main/java/org/eolang/parser/Objects.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ interface Objects extends Iterable<Directive> {
Objects prop(String key, Object value);

/**
* Empty propery.
* Empty property.
* @param key Key.
* @return Self.
*/
Expand Down
2 changes: 1 addition & 1 deletion eo-runtime/src/main/java/EOorg/EOeolang/Cages.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ private Cages() {
/**
* Encage object for the first time.
* When object is encaged - locator will be generated.
* @param object Object ot encage
* @param object Object to encage
* @return Locator to the object in cage
*/
int init(final Phi object) {
Expand Down
4 changes: 2 additions & 2 deletions eo-runtime/src/test/eo/org/eolang/bytes-tests.eo
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@
53.as-bytes.not

# Test.
[] > conjuction-of-bytes
[] > conjunction-of-bytes
02-EF-D4-05-5E-78-3A > a
12-33-C1-B5-5E-71-55 > b
eq. > @
Expand All @@ -286,7 +286,7 @@
1

# Test.
[] > convertable-to-bool
[] > convertible-to-bool
not. > @
eq.
01-.as-bool
Expand Down
2 changes: 1 addition & 1 deletion eo-runtime/src/test/eo/org/eolang/seq-tests.eo
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EcounterPRESS OR
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
Expand Down
Loading

0 comments on commit dbb8927

Please sign in to comment.