Skip to content

Commit

Permalink
ci: decomission of CheckStyle
Browse files Browse the repository at this point in the history
The following issue won't be fixed:
Closes #260
Closes #1015

Part of #1669
  • Loading branch information
php-coder committed Feb 24, 2024
1 parent b77bce7 commit 0248534
Show file tree
Hide file tree
Showing 53 changed files with 7 additions and 433 deletions.
24 changes: 0 additions & 24 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,30 +15,6 @@ defaults:
shell: bash

jobs:
run-checkstyle:
name: Run CheckStyle
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idruns-on
runs-on: ubuntu-20.04
steps:
- name: Clone source code
uses: actions/[email protected] # https://github.com/actions/checkout
with:
# Whether to configure the token or SSH key with the local git config. Default: true
persist-credentials: false
- name: Install JDK
uses: actions/[email protected] # https://github.com/actions/setup-java
with:
distribution: 'adopt' # https://github.com/actions/setup-java#supported-distributions
java-version: '8' # https://github.com/actions/setup-java#supported-version-syntax
- name: Restore existing cache
uses: actions/[email protected] # https://github.com/actions/cache
with:
# https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#input-parameters-for-the-cache-action
key: maven-repository-${{ hashFiles('pom.xml') }}
path: ~/.m2/repository
restore-keys: maven-repository-
- name: Run CheckStyle
run: ./src/main/scripts/execute-command.sh checkstyle

run-pmd:
name: Run PMD
Expand Down
15 changes: 0 additions & 15 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,6 @@
<bootstrap.version>3.4.1</bootstrap.version>

<cglib.version>2.2.2</cglib.version>
<checkstyle.plugin.version>2.17</checkstyle.plugin.version>
<clean.plugin.version>3.0.0</clean.plugin.version>

<!-- Redefine default value from spring-boot-dependencies -->
Expand Down Expand Up @@ -831,20 +830,6 @@
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>${checkstyle.plugin.version}</version>
<configuration>
<enableRSS>false</enableRSS>
<consoleOutput>true</consoleOutput>
<includeTestSourceDirectory>true</includeTestSourceDirectory>
<linkXRef>false</linkXRef>
<configLocation>${basedir}/src/main/config/checkstyle.xml</configLocation>
<suppressionsLocation>${basedir}/src/main/config/checkstyle-suppressions.xml</suppressionsLocation>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
Expand Down
17 changes: 0 additions & 17 deletions src/main/config/checkstyle-suppressions.xml

This file was deleted.

276 changes: 0 additions & 276 deletions src/main/config/checkstyle.xml

This file was deleted.

2 changes: 0 additions & 2 deletions src/main/java/ru/mystamps/web/common/Pager.java
Original file line number Diff line number Diff line change
Expand Up @@ -145,14 +145,12 @@ private static List<Integer> createItems(
nextItemsCnt--;
}

// CheckStyle: ignore LineLength for next 3 lines
// we've added too much to the beginning
} else if (prevItemsCnt > ITEMS_BEFORE_CURRENT && nextItemsCnt <= ITEMS_AFTER_CURRENT) {
while (prevItemsCnt > ITEMS_BEFORE_CURRENT && (prevItemsCnt + nextItemsCnt + 1) > MAX_ITEMS) {
prevItemsCnt--;
}

// CheckStyle: ignore LineLength for next 3 lines
// we've added too much to the end
} else if (nextItemsCnt > ITEMS_AFTER_CURRENT && prevItemsCnt <= ITEMS_BEFORE_CURRENT) {
while (nextItemsCnt > ITEMS_AFTER_CURRENT && (prevItemsCnt + nextItemsCnt + 1) > MAX_ITEMS) {
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/ru/mystamps/web/config/MvcConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ public void addResourceHandlers(ResourceHandlerRegistry registry) {
VersionResourceResolver resourceResolver = new VersionResourceResolver()
.addFixedVersionStrategy(ResourceUrl.RESOURCES_VERSION, "/**");

// CheckStyle: ignore MagicNumber for next 1 line
CacheControl cacheControl = CacheControl.maxAge(Duration.ofDays(7));

registry.addResourceHandler("/static/**")
Expand Down Expand Up @@ -168,7 +167,6 @@ public void addInterceptors(InterceptorRegistry registry) {
}

@Override
// CheckStyle: ignore LineLength for next 2 lines
// LATER: remove deprecation and usage of setUseSuffixPatternMatch() during upgrade to Spring Framework 5.3
// See: https://docs.spring.io/spring-framework/docs/5.2.22.RELEASE/javadoc-api/org/springframework/web/servlet/config/annotation/PathMatchConfigurer.html#setUseSuffixPatternMatch-java.lang.Boolean-
@SuppressWarnings("deprecation")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ public class JdbcUsersActivationDao implements UsersActivationDao {
private final String removeByActivationKeySql;
private final String addActivationKeySql;

@SuppressWarnings("checkstyle:linelength")
public JdbcUsersActivationDao(Environment env, NamedParameterJdbcTemplate jdbcTemplate) {
this.jdbcTemplate = jdbcTemplate;
this.findByActivationKeySql = env.getRequiredProperty("users_activation.find_by_activation_key");
Expand Down
Loading

0 comments on commit 0248534

Please sign in to comment.