Skip to content

Commit

Permalink
Refactor packages in pg-index-health-core (#505)
Browse files Browse the repository at this point in the history
* Upgrade Gradle

* Refactor to io.github.mfvanek.pg.core.support

* Package io.github.mfvanek.pg.checks.host was renamed to io.github.mfvanek.pg.core.checks.host
Package io.github.mfvanek.pg.checks.extractors was renamed to io.github.mfvanek.pg.core.checks.extractors

* Refactor fixtures packages

* Package io.github.mfvanek.pg.utils was renamed to io.github.mfvanek.pg.core.utils
Package io.github.mfvanek.pg.common.maintenance was renamed to io.github.mfvanek.pg.core.checks.common
Package io.github.mfvanek.pg.settings was renamed to io.github.mfvanek.pg.core.settings
Package io.github.mfvanek.pg.statistics was renamed to io.github.mfvanek.pg.core.statistics

* Reorder imports

* Spotbugs
  • Loading branch information
mfvanek authored Nov 21, 2024
1 parent 210b020 commit 806b6f0
Show file tree
Hide file tree
Showing 229 changed files with 568 additions and 579 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ dependencies {

tasks{
wrapper {
gradleVersion = "8.11"
gradleVersion = "8.11.1"
}

check {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ java {
tasks {
withType<JavaCompile>().configureEach {
options.compilerArgs.add("-parameters")
options.compilerArgs.add("--should-stop=ifError=FLOW")
}

test {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ plugins {
}

dependencies {
errorprone("com.google.errorprone:error_prone_core:2.35.1")
errorprone("com.google.errorprone:error_prone_core:2.36.0")
errorprone("jp.skypencil.errorprone.slf4j:errorprone-slf4j:0.1.28")

spotbugsPlugins("jp.skypencil.findbugs.slf4j:bug-pattern:1.5.0")
Expand Down
19 changes: 3 additions & 16 deletions config/spotbugs/exclude.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,7 @@
<Bug pattern="EI_EXPOSE_REP,EI_EXPOSE_REP2,CT_CONSTRUCTOR_THROW"/>
</Match>
<Match>
<Bug pattern="SQL_NONCONSTANT_STRING_PASSED_TO_EXECUTE"/>
<Or>
<Class name="io.github.mfvanek.pg.settings.maintenance.ConfigurationMaintenanceOnHostImpl"/>
<Class name="~.*TestBase"/>
<Class name="~io.github.mfvanek.pg.support.*"/>
<Class name="~.*Test"/>
</Or>
</Match>
<Match>
<Bug pattern="SQL_PREPARED_STATEMENT_GENERATED_FROM_NONCONSTANT_STRING"/>
<Or>
<Class name="~io.github.mfvanek.pg.support.*"/>
<Class name="io.github.mfvanek.pg.utils.QueryExecutorsTest"/>
</Or>
<Bug pattern="SQL_NONCONSTANT_STRING_PASSED_TO_EXECUTE,SQL_PREPARED_STATEMENT_GENERATED_FROM_NONCONSTANT_STRING"/>
</Match>
<Match>
<Bug pattern="EC_NULL_ARG,EC_UNRELATED_TYPES,EC_UNRELATED_CLASS_AND_INTERFACE,NM_CONFUSING,NP_NONNULL_PARAM_VIOLATION,DP_DO_INSIDE_DO_PRIVILEGED"/>
Expand All @@ -47,7 +34,7 @@
<Class name="io.github.mfvanek.pg.model.table.Table"/>
<Class name="io.github.mfvanek.pg.generator.utils.StringUtils"/>
<Class name="io.github.mfvanek.pg.generator.GeneratingOptions$Builder"/>
<Class name="io.github.mfvanek.pg.common.maintenance.Diagnostic"/>
<Class name="io.github.mfvanek.pg.core.checks.common.Diagnostic"/>
</Or>
</Match>
<Match>
Expand Down Expand Up @@ -107,7 +94,7 @@
</Match>
<Match>
<Bug pattern="ACEM_ABSTRACT_CLASS_EMPTY_METHODS"/>
<Class name="io.github.mfvanek.pg.support.statements.AbstractDbStatement"/>
<Class name="io.github.mfvanek.pg.core.fixtures.support.statements.AbstractDbStatement"/>
</Match>
<Match>
<Bug pattern="ITC_INHERITANCE_TYPE_CHECKING"/>
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ detekt = "1.23.6"
commons-lang3 = "3.17.0"
slf4j = "1.7.36" # to be compatible with Spring Boot 2.7.X
assertj = "3.26.3"
testcontainers = "1.20.3"
testcontainers = "1.20.4"
junit = "5.11.3"
mockito = "5.14.2"
forbiddenapis = "3.8"
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* Licensed under the Apache License 2.0
*/

package io.github.mfvanek.pg.common.maintenance;
package io.github.mfvanek.pg.core.checks.common;

/**
* Allows getting information about check/diagnostic type.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* Licensed under the Apache License 2.0
*/

package io.github.mfvanek.pg.common.maintenance;
package io.github.mfvanek.pg.core.checks.common;

import io.github.mfvanek.pg.connection.host.HostAware;
import io.github.mfvanek.pg.model.context.PgContext;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
* Licensed under the Apache License 2.0
*/

package io.github.mfvanek.pg.common.maintenance;
package io.github.mfvanek.pg.core.checks.common;

import io.github.mfvanek.pg.utils.QueryExecutors;
import io.github.mfvanek.pg.core.utils.QueryExecutors;

import java.util.Objects;
import javax.annotation.Nonnull;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* Licensed under the Apache License 2.0
*/

package io.github.mfvanek.pg.common.maintenance;
package io.github.mfvanek.pg.core.checks.common;

import javax.annotation.Nonnull;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* Licensed under the Apache License 2.0
*/

package io.github.mfvanek.pg.common.maintenance;
package io.github.mfvanek.pg.core.checks.common;

import io.github.mfvanek.pg.connection.PgConnection;
import io.github.mfvanek.pg.model.context.PgContext;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* Licensed under the Apache License 2.0
*/

package io.github.mfvanek.pg.common.maintenance;
package io.github.mfvanek.pg.core.checks.common;

import io.github.mfvanek.pg.model.dbobject.DbObject;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* Licensed under the Apache License 2.0
*/

package io.github.mfvanek.pg.common.maintenance;
package io.github.mfvanek.pg.core.checks.common;

import java.sql.ResultSet;
import java.sql.SQLException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@
* Licensed under the Apache License 2.0
*/

package io.github.mfvanek.pg.checks.extractors;
package io.github.mfvanek.pg.core.checks.extractors;

import io.github.mfvanek.pg.common.maintenance.ResultSetExtractor;
import io.github.mfvanek.pg.core.checks.common.ResultSetExtractor;
import io.github.mfvanek.pg.model.column.Column;

import java.sql.ResultSet;
import java.sql.SQLException;
import javax.annotation.Nonnull;

import static io.github.mfvanek.pg.checks.extractors.TableExtractor.TABLE_NAME;
import static io.github.mfvanek.pg.core.checks.extractors.TableExtractor.TABLE_NAME;

/**
* A mapper from raw data to {@link Column} model.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
* Licensed under the Apache License 2.0
*/

package io.github.mfvanek.pg.checks.extractors;
package io.github.mfvanek.pg.core.checks.extractors;

import io.github.mfvanek.pg.common.maintenance.ResultSetExtractor;
import io.github.mfvanek.pg.core.checks.common.ResultSetExtractor;
import io.github.mfvanek.pg.model.column.Column;
import io.github.mfvanek.pg.model.column.ColumnWithSerialType;
import io.github.mfvanek.pg.model.column.SerialType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
* Licensed under the Apache License 2.0
*/

package io.github.mfvanek.pg.checks.extractors;
package io.github.mfvanek.pg.core.checks.extractors;

import io.github.mfvanek.pg.common.maintenance.ResultSetExtractor;
import io.github.mfvanek.pg.core.checks.common.ResultSetExtractor;
import io.github.mfvanek.pg.model.constraint.DuplicatedForeignKeys;
import io.github.mfvanek.pg.model.constraint.ForeignKey;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
* Licensed under the Apache License 2.0
*/

package io.github.mfvanek.pg.checks.extractors;
package io.github.mfvanek.pg.core.checks.extractors;

import io.github.mfvanek.pg.common.maintenance.ResultSetExtractor;
import io.github.mfvanek.pg.core.checks.common.ResultSetExtractor;
import io.github.mfvanek.pg.core.utils.ColumnsInForeignKeyParser;
import io.github.mfvanek.pg.model.column.Column;
import io.github.mfvanek.pg.model.constraint.ForeignKey;
import io.github.mfvanek.pg.utils.ColumnsInForeignKeyParser;

import java.sql.Array;
import java.sql.ResultSet;
Expand All @@ -22,7 +22,7 @@
import java.util.Objects;
import javax.annotation.Nonnull;

import static io.github.mfvanek.pg.checks.extractors.TableExtractor.TABLE_NAME;
import static io.github.mfvanek.pg.core.checks.extractors.TableExtractor.TABLE_NAME;

/**
* A mapper from raw data to {@link ForeignKey} model.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@
* Licensed under the Apache License 2.0
*/

package io.github.mfvanek.pg.checks.extractors;
package io.github.mfvanek.pg.core.checks.extractors;

import io.github.mfvanek.pg.common.maintenance.ResultSetExtractor;
import io.github.mfvanek.pg.core.checks.common.ResultSetExtractor;
import io.github.mfvanek.pg.model.column.Column;
import io.github.mfvanek.pg.model.index.IndexWithColumns;

import java.sql.ResultSet;
import java.sql.SQLException;
import javax.annotation.Nonnull;

import static io.github.mfvanek.pg.checks.extractors.TableExtractor.TABLE_NAME;
import static io.github.mfvanek.pg.core.checks.extractors.TableExtractor.TABLE_NAME;

/**
* A mapper from raw data to {@link IndexWithColumns} model.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
* Licensed under the Apache License 2.0
*/

package io.github.mfvanek.pg.checks.extractors;
package io.github.mfvanek.pg.core.checks.extractors;

import io.github.mfvanek.pg.common.maintenance.ResultSetExtractor;
import io.github.mfvanek.pg.core.checks.common.ResultSetExtractor;
import io.github.mfvanek.pg.model.table.Table;

import java.sql.ResultSet;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@
* Licensed under the Apache License 2.0
*/

package io.github.mfvanek.pg.checks.host;
package io.github.mfvanek.pg.core.checks.host;

import io.github.mfvanek.pg.checks.extractors.IndexWithSingleColumnExtractor;
import io.github.mfvanek.pg.checks.extractors.TableExtractor;
import io.github.mfvanek.pg.common.maintenance.DatabaseCheckOnHost;
import io.github.mfvanek.pg.common.maintenance.Diagnostic;
import io.github.mfvanek.pg.common.maintenance.ResultSetExtractor;
import io.github.mfvanek.pg.connection.PgConnection;
import io.github.mfvanek.pg.connection.host.PgHost;
import io.github.mfvanek.pg.core.checks.common.DatabaseCheckOnHost;
import io.github.mfvanek.pg.core.checks.common.Diagnostic;
import io.github.mfvanek.pg.core.checks.common.ResultSetExtractor;
import io.github.mfvanek.pg.core.checks.extractors.IndexWithSingleColumnExtractor;
import io.github.mfvanek.pg.core.checks.extractors.TableExtractor;
import io.github.mfvanek.pg.core.utils.SqlQueryReader;
import io.github.mfvanek.pg.model.context.PgContext;
import io.github.mfvanek.pg.model.dbobject.DbObject;
import io.github.mfvanek.pg.utils.SqlQueryReader;

import java.sql.ResultSet;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
* Licensed under the Apache License 2.0
*/

package io.github.mfvanek.pg.checks.host;
package io.github.mfvanek.pg.core.checks.host;

import io.github.mfvanek.pg.checks.extractors.IndexWithSingleColumnExtractor;
import io.github.mfvanek.pg.common.maintenance.Diagnostic;
import io.github.mfvanek.pg.connection.PgConnection;
import io.github.mfvanek.pg.core.checks.common.Diagnostic;
import io.github.mfvanek.pg.core.checks.extractors.IndexWithSingleColumnExtractor;
import io.github.mfvanek.pg.model.context.PgContext;
import io.github.mfvanek.pg.model.index.IndexWithColumns;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
* Licensed under the Apache License 2.0
*/

package io.github.mfvanek.pg.checks.host;
package io.github.mfvanek.pg.core.checks.host;

import io.github.mfvanek.pg.checks.extractors.ColumnExtractor;
import io.github.mfvanek.pg.common.maintenance.Diagnostic;
import io.github.mfvanek.pg.connection.PgConnection;
import io.github.mfvanek.pg.core.checks.common.Diagnostic;
import io.github.mfvanek.pg.core.checks.extractors.ColumnExtractor;
import io.github.mfvanek.pg.model.column.Column;
import io.github.mfvanek.pg.model.context.PgContext;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
* Licensed under the Apache License 2.0
*/

package io.github.mfvanek.pg.checks.host;
package io.github.mfvanek.pg.core.checks.host;

import io.github.mfvanek.pg.checks.extractors.ColumnWithSerialTypeExtractor;
import io.github.mfvanek.pg.common.maintenance.Diagnostic;
import io.github.mfvanek.pg.connection.PgConnection;
import io.github.mfvanek.pg.core.checks.common.Diagnostic;
import io.github.mfvanek.pg.core.checks.extractors.ColumnWithSerialTypeExtractor;
import io.github.mfvanek.pg.model.column.ColumnWithSerialType;
import io.github.mfvanek.pg.model.context.PgContext;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
* Licensed under the Apache License 2.0
*/

package io.github.mfvanek.pg.checks.host;
package io.github.mfvanek.pg.core.checks.host;

import io.github.mfvanek.pg.checks.extractors.ColumnExtractor;
import io.github.mfvanek.pg.common.maintenance.Diagnostic;
import io.github.mfvanek.pg.connection.PgConnection;
import io.github.mfvanek.pg.core.checks.common.Diagnostic;
import io.github.mfvanek.pg.core.checks.extractors.ColumnExtractor;
import io.github.mfvanek.pg.model.column.Column;
import io.github.mfvanek.pg.model.context.PgContext;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
* Licensed under the Apache License 2.0
*/

package io.github.mfvanek.pg.checks.host;
package io.github.mfvanek.pg.core.checks.host;

import io.github.mfvanek.pg.checks.extractors.DuplicatedForeignKeysExtractor;
import io.github.mfvanek.pg.common.maintenance.Diagnostic;
import io.github.mfvanek.pg.connection.PgConnection;
import io.github.mfvanek.pg.core.checks.common.Diagnostic;
import io.github.mfvanek.pg.core.checks.extractors.DuplicatedForeignKeysExtractor;
import io.github.mfvanek.pg.model.constraint.DuplicatedForeignKeys;
import io.github.mfvanek.pg.model.context.PgContext;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
* Licensed under the Apache License 2.0
*/

package io.github.mfvanek.pg.checks.host;
package io.github.mfvanek.pg.core.checks.host;

import io.github.mfvanek.pg.common.maintenance.Diagnostic;
import io.github.mfvanek.pg.connection.PgConnection;
import io.github.mfvanek.pg.core.checks.common.Diagnostic;
import io.github.mfvanek.pg.model.context.PgContext;
import io.github.mfvanek.pg.model.index.DuplicatedIndexes;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
* Licensed under the Apache License 2.0
*/

package io.github.mfvanek.pg.checks.host;
package io.github.mfvanek.pg.core.checks.host;

import io.github.mfvanek.pg.checks.extractors.ForeignKeyExtractor;
import io.github.mfvanek.pg.common.maintenance.Diagnostic;
import io.github.mfvanek.pg.connection.PgConnection;
import io.github.mfvanek.pg.core.checks.common.Diagnostic;
import io.github.mfvanek.pg.core.checks.extractors.ForeignKeyExtractor;
import io.github.mfvanek.pg.model.constraint.ForeignKey;
import io.github.mfvanek.pg.model.context.PgContext;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
* Licensed under the Apache License 2.0
*/

package io.github.mfvanek.pg.checks.host;
package io.github.mfvanek.pg.core.checks.host;

import io.github.mfvanek.pg.checks.extractors.ForeignKeyExtractor;
import io.github.mfvanek.pg.common.maintenance.Diagnostic;
import io.github.mfvanek.pg.connection.PgConnection;
import io.github.mfvanek.pg.core.checks.common.Diagnostic;
import io.github.mfvanek.pg.core.checks.extractors.ForeignKeyExtractor;
import io.github.mfvanek.pg.model.constraint.ForeignKey;
import io.github.mfvanek.pg.model.context.PgContext;

Expand Down
Loading

0 comments on commit 806b6f0

Please sign in to comment.