Skip to content

Instantly share code, notes, and snippets.

View artsok's full-sized avatar

Artem Sokovets artsok

  • Emirates Airline/ex. Sberbank Technologies JSC.
  • Dubai
View GitHub Profile
<!-- ===================================================================== -->
<!-- ======================== Checkstyle ================================= -->
<!-- ===================================================================== -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>${checkstyle-plugin.version}</version>
<dependencies>
<dependency>
<groupId>com.puppycrawl.tools</groupId>
Understanding AST
AST Tree
RooT
-sibling
|-child
|-sibling
|-sibling
-Sibling
@artsok
artsok / AbstractCheck_checkstyle.csv
Last active October 5, 2023 08:06
AbstractCheck class from Checkstyle
Method Description
getDefaultTokens() This method defines the default set of tokens that the check will operate on if no specific token configuration is provided
getAcceptableTokens() This method specifies a list of acceptable tokens for the check meaning the tokens that the check can analyze without reporting issues
getRequiredTokens() This method defines a list of required tokens that must be present for the check to execute successfully
visitToken(DetailAST ast) This method is called for each token encountered during the check's analysis of the source code. It allows the check to inspect and evaluate individual tokens in the code making decisions or reporting issues based on the characteristics of each token
@artsok
artsok / diff-changed-lines.sh
Created October 4, 2023 08:38 — forked from mdawaffe/diff-changed-lines.sh
Get line numbers of changed lines - git, diff - Full of bashisms
#!/bin/bash
# Call like you would `diff`
# `./diff-changed-lines.sh old new`
# Outputs the lines numbers of the new file
# that are not present in the old file.
# That is, outputs line numbers for new lines and changed lines
# and does not output line numbers deleted or unchanged lines.
@artsok
artsok / Jenkinsfile
Created November 18, 2020 11:52 — forked from merikan/Jenkinsfile
Some Jenkinsfile examples
Some Jenkinsfile examples
@artsok
artsok / dockerFile
Created January 30, 2020 14:01
docker_wildfly
FROM jboss/wildfly:15.0.0.Final
EXPOSE 8080
COPY target/springbootwildfly.war /opt/jboss/wildfly/standalone/deployments/
CMD ["/opt/jboss/wildfly/bin/standalone.sh", "-b", "0.0.0.0", "-bmanagement","0.0.0.0"]
@artsok
artsok / openshift-template-wildfly
Created January 30, 2020 14:01
openshift-wildfly-app
apiVersion: v1
kind: Template
labels:
template: rest-coverage
metadata:
annotations:
description: Application template for application.
iconClass: icon-jboss
tags: ufs,coverage,rest
version: 0.0.1
@artsok
artsok / AllureLogger.java
Created October 15, 2019 09:26
AllureLogger for Atlas-framework
import io.qameta.allure.Allure;
import io.qameta.allure.AllureLifecycle;
import io.qameta.allure.model.Status;
import io.qameta.allure.model.StepResult;
import io.qameta.allure.util.ResultsUtils;
import io.qameta.atlas.core.api.Listener;
import io.qameta.atlas.core.api.Target;
import io.qameta.atlas.core.context.TargetContext;
import io.qameta.atlas.core.internal.Configuration;
import io.qameta.atlas.core.util.MethodInfo;
@artsok
artsok / a.java
Last active October 13, 2019 08:22
public interface MainPage extends WebPage, WithHeader {
@FindBy("//a[contains(text(), 'Or start a free)]")
AtlasWebElement trial();
}
@artsok
artsok / huge_step_class.java
Last active October 13, 2019 07:58
Huge step class
public class MainSteps {
public void hasText(HtmlElement e, Matcher m)
public void hasValue(HtmlElement e, Matcher m)
public void linkContains(HtmlElement e, String s)
public void hasSize(List<HtmlElement> e, Matcher m)
public void hasItem(List<HtmlElement> e, Matcher m)
//...
}