Skip to content

Commit

Permalink
feat(objectionary#946): fix all the code offences
Browse files Browse the repository at this point in the history
  • Loading branch information
volodya-lombrozo committed Jan 13, 2025
1 parent f97cf6d commit 057dc6c
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ public Iterator<Directive> iterator() {
if (!this.name.pckg().isEmpty()) {
result.append(this.pckg());
}
result.append(this.unlint());
result.append(this.version());
result.append(DirectivesMetas.unlint());
result.append(DirectivesMetas.version());
return result.up().iterator();
}

Expand Down Expand Up @@ -90,7 +90,7 @@ private Directives pckg() {
* The version directives of jeo-maven-plugin.
* @return Version directives.
*/
private Directives version() {
private static Directives version() {
return new Directives()
.add("meta")
.add("head").set("version").up()
Expand All @@ -102,7 +102,7 @@ private Directives version() {
* Ignored XMIR checks.
* @return Directives for ignored checks.
*/
private Directives unlint() {
private static Directives unlint() {
return new Directives()
.add("meta")
.add("head").set("unlint").up()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,13 +157,15 @@ public boolean hasAttribute(final String name, final String value) {

@Override
public void validate() {
final Collection<String> ignore = new HashSet<>(Arrays.asList(
"mandatory-home",
"name-outside-of-abstract-object",
"empty-object",
"incorrect-package",
"object-does-not-match-filename"
));
final Collection<String> ignore = new HashSet<>(
Arrays.asList(
"mandatory-home",
"name-outside-of-abstract-object",
"empty-object",
"incorrect-package",
"object-does-not-match-filename"
)
);
final Collection<Defect> defects = new Program(new StrictXmir(this.doc))
.defects()
.stream()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@

import com.jcabi.log.Logger;
import com.jcabi.matchers.XhtmlMatchers;
import com.jcabi.xml.XML;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
Expand Down Expand Up @@ -62,13 +61,11 @@ final class XmirRepresentationTest {
void retrievesName() {
final String name = "Math";
final String expected = "j$org/j$eolang/j$foo/j$Math";
final XML xml = new BytecodeProgram(
"org/eolang/foo",
new BytecodeClass(name)
).xml();
System.out.println(xml);
final String actual = new XmirRepresentation(
xml
new BytecodeProgram(
"org/eolang/foo",
new BytecodeClass(name)
).xml()
).name();
MatcherAssert.assertThat(
String.format(
Expand Down

0 comments on commit 057dc6c

Please sign in to comment.