Skip to content

Commit

Permalink
Merge branch 'master' into fix/#3147/remove-sigma
Browse files Browse the repository at this point in the history
  • Loading branch information
maxonfjvipon committed May 8, 2024
2 parents d35a829 + d1e79ba commit 1a20501
Show file tree
Hide file tree
Showing 42 changed files with 581 additions and 282 deletions.
129 changes: 66 additions & 63 deletions eo-maven-plugin/pom.xml
Expand Up @@ -435,68 +435,75 @@ SOFTWARE.
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<executions>
<execution>
<id>jacoco-initialize</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>jacoco-check</id>
<phase>test</phase>
<goals>
<goal>check</goal>
<goal>report</goal>
</goals>
<configuration>
<rules>
<rule>
<element>BUNDLE</element>
<limits>
<limit>
<counter>INSTRUCTION</counter>
<value>COVEREDRATIO</value>
<minimum>0.70</minimum>
</limit>
<limit>
<counter>LINE</counter>
<value>COVEREDRATIO</value>
<minimum>0.73</minimum>
</limit>
<limit>
<counter>BRANCH</counter>
<value>COVEREDRATIO</value>
<minimum>0.54</minimum>
</limit>
<limit>
<counter>COMPLEXITY</counter>
<value>COVEREDRATIO</value>
<minimum>0.60</minimum>
</limit>
<limit>
<counter>METHOD</counter>
<value>COVEREDRATIO</value>
<minimum>0.79</minimum>
</limit>
<limit>
<counter>CLASS</counter>
<value>MISSEDCOUNT</value>
<maximum>8</maximum>
</limit>
</limits>
</rule>
</rules>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>jacoco</id>
<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<executions>
<execution>
<id>jacoco-initialize</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>jacoco-check</id>
<phase>test</phase>
<goals>
<goal>check</goal>
<goal>report</goal>
</goals>
<configuration>
<rules>
<rule>
<element>BUNDLE</element>
<limits>
<limit>
<counter>INSTRUCTION</counter>
<value>COVEREDRATIO</value>
<minimum>0.70</minimum>
</limit>
<limit>
<counter>LINE</counter>
<value>COVEREDRATIO</value>
<minimum>0.73</minimum>
</limit>
<limit>
<counter>BRANCH</counter>
<value>COVEREDRATIO</value>
<minimum>0.54</minimum>
</limit>
<limit>
<counter>COMPLEXITY</counter>
<value>COVEREDRATIO</value>
<minimum>0.60</minimum>
</limit>
<limit>
<counter>METHOD</counter>
<value>COVEREDRATIO</value>
<minimum>0.79</minimum>
</limit>
<limit>
<counter>CLASS</counter>
<value>MISSEDCOUNT</value>
<maximum>8</maximum>
</limit>
</limits>
</rule>
</rules>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>qulice</id>
<build>
Expand All @@ -516,10 +523,6 @@ SOFTWARE.
</excludes>
</configuration>
</plugin>
<plugin>
<groupId>com.github.volodya-lombrozo</groupId>
<artifactId>jtcop-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</profile>
Expand Down
Expand Up @@ -41,6 +41,31 @@
*/
public final class CommitHashesMap extends MapEnvelope<String, CommitHash> {

/**
* Fake hashes.
*/
static final String FAKES = String.join(
"\n",
"5fe5ad8d21dbe418038fa4c86e096fb037f290a9 0.23.15",
"15c85d7f8cffe15b0deba96e90bdac98a76293bb 0.23.17",
"4b19944d86058e3c81e558340a3a13bc335a2b48 0.23.19",
"0aa6875c40d099c3f670e93d4134b629566c5643 0.25.0",
"ff32e9ff70c2b3be75982757f4b0607dc37b258a 0.25.5",
"e0b783692ef749bb184244acb2401f551388a328 0.26.0",
"cc554ab82909eebbfdacd8a840f9cf42a99b64cf 0.27.0",
"00b60c7b2112cbad4e37ba96b162469a0e75f6df 0.27.2",
"6a70071580e95aeac104b2e48293d3dfe0669973 0.28.0",
"0c15066a2026cec69d613b709a301f1573f138ec 0.28.1",
"9b883935257bd59d1ba36240f7e213d4890df7ca 0.28.10",
"a7a4556bf1aa697324d805570f42d70affdddb75 0.28.14",
"54d83d4b1d28075ee623d58fd742eaa529febd3d 0.28.2",
"6c6269d1f9a1c81ffe641538f119fe4e12706cb3 0.28.4",
"9c9352890b5d30e1b89c9147e7c95a90c9b8709f 0.28.5",
"17f89293e5ae6115e9a0234b754b22918c11c602 0.28.6",
"5f82cc1edffad67bf4ba816610191403eb18af5d 0.28.7",
"be83d9adda4b7c9e670e625fe951c80f3ead4177 0.28.9"
);

/**
* Whitespace pattern.
*/
Expand Down Expand Up @@ -105,31 +130,7 @@ public static final class Fake extends MapEnvelope<String, CommitHash> {
* Ctor.
*/
public Fake() {
super(
new CommitHashesMap(
String.join(
"\n",
"5fe5ad8d21dbe418038fa4c86e096fb037f290a9 0.23.15",
"15c85d7f8cffe15b0deba96e90bdac98a76293bb 0.23.17",
"4b19944d86058e3c81e558340a3a13bc335a2b48 0.23.19",
"0aa6875c40d099c3f670e93d4134b629566c5643 0.25.0",
"ff32e9ff70c2b3be75982757f4b0607dc37b258a 0.25.5",
"e0b783692ef749bb184244acb2401f551388a328 0.26.0",
"cc554ab82909eebbfdacd8a840f9cf42a99b64cf 0.27.0",
"00b60c7b2112cbad4e37ba96b162469a0e75f6df 0.27.2",
"6a70071580e95aeac104b2e48293d3dfe0669973 0.28.0",
"0c15066a2026cec69d613b709a301f1573f138ec 0.28.1",
"9b883935257bd59d1ba36240f7e213d4890df7ca 0.28.10",
"a7a4556bf1aa697324d805570f42d70affdddb75 0.28.14",
"54d83d4b1d28075ee623d58fd742eaa529febd3d 0.28.2",
"6c6269d1f9a1c81ffe641538f119fe4e12706cb3 0.28.4",
"9c9352890b5d30e1b89c9147e7c95a90c9b8709f 0.28.5",
"17f89293e5ae6115e9a0234b754b22918c11c602 0.28.6",
"5f82cc1edffad67bf4ba816610191403eb18af5d 0.28.7",
"be83d9adda4b7c9e670e625fe951c80f3ead4177 0.28.9"
)
)
);
super(new CommitHashesMap(CommitHashesMap.FAKES));
}
}
}
Expand Up @@ -24,6 +24,7 @@
package org.eolang.maven.hash;

import com.jcabi.aspects.RetryOnFailure;
import com.jcabi.log.Logger;
import java.net.URL;
import java.util.concurrent.TimeUnit;
import org.cactoos.scalar.Unchecked;
Expand All @@ -32,8 +33,9 @@

/**
* Commit hashes table as text from objectionary.
* This class serves the purpose of the global cache in order to avoid
* downloading the list of tags multiple times from objectionary.
*
* <p>This class serves the purpose of the global cache in order to avoid
* downloading the list of tags multiple times from objectionary.</p>
*
* @since 0.29.6
*/
Expand Down Expand Up @@ -64,7 +66,20 @@ final class CommitHashesText extends TextEnvelope {
@RetryOnFailure(delay = 1L, unit = TimeUnit.SECONDS)
private static String asText(final String url) {
return new Unchecked<>(
() -> new TextOf(new URL(url)).asString()
() -> {
String hashes;
try {
hashes = new TextOf(new URL(url)).asString();
} catch (final java.net.UnknownHostException ex) {
Logger.warn(
CommitHashesText.class,
"Can't load hashes: %[exception]s",
ex
);
hashes = CommitHashesMap.FAKES;
}
return hashes;
}
).value();
}
}
Expand Up @@ -32,10 +32,10 @@ SOFTWARE.
<rusts>
<xsl:comment>"Rust inserts"</xsl:comment>
<xsl:for-each select="//o">
<xsl:if test="../attribute(base) = '.rust' and attribute(base) = 'org.eolang.string'">
<xsl:if test="(../attribute(base) = 'org.eolang.rust' or (../attribute(base) = '.rust' and ../o[1]/attribute(base) = '.eolang' and ../o[1]/o[1]/attribute(base) = '.org' and ../o[1]/o[1]/o[1]/attribute(base) = 'Q')) and (attribute(base) = 'org.eolang.string' or (attribute(base) = '.string' and o[1]/attribute(base) = '.eolang' and o[1]/o[1]/attribute(base) = '.org' and o[1]/o[1]/o[1]/attribute(base) = 'Q'))">
<rust>
<xsl:attribute name="code">
<xsl:value-of select="./o/text()"/>
<xsl:value-of select="./o[@data = 'bytes']/text()"/>
</xsl:attribute>
<xsl:attribute name="code_loc">
<xsl:value-of select="attribute(loc)"/>
Expand Down
Expand Up @@ -23,6 +23,7 @@
*/
package org.eolang.maven;

import com.yegor256.WeAreOnline;
import java.io.File;
import java.io.IOException;
import java.nio.file.Path;
Expand All @@ -43,6 +44,7 @@
*
* @since 0.1
*/
@ExtendWith(WeAreOnline.class)
final class BinarizeMojoTest {

/**
Expand Down
Expand Up @@ -151,7 +151,7 @@ void binarizesTwiceRustProgram(@TempDir final Path temp) throws Exception {
@ClasspathSource(value = "org/eolang/maven/binarize/add_rust/", glob = "**.yaml")
void createsDependenciesSection(final String yaml) {
MatcherAssert.assertThat(
BinarizeParseTest.TO_ADD_MESSAGE,
"Yaml tests should pass",
new XaxStory(yaml),
Matchers.is(true)
);
Expand Down

0 comments on commit 1a20501

Please sign in to comment.