Skip to content

Commit

Permalink
Linting
Browse files Browse the repository at this point in the history
  • Loading branch information
StevenLooman committed Sep 14, 2023
1 parent 617751f commit 2226216
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ public CompletableFuture<Hover> hover(final HoverParams params) {
LOGGER.debug("Implementations found: {}", locations.size());

final List<Location> lsp4jLocations = locations.stream()
.map(location -> Lsp4jConversion.locationToLsp4j(location))
.map(Lsp4jConversion::locationToLsp4j)
.collect(Collectors.toList());
return Either.forLeft(lsp4jLocations);
});
Expand Down Expand Up @@ -351,7 +351,7 @@ public CompletableFuture<Either<List<? extends Location>, List<? extends Locatio
LOGGER.debug("Definitions found: {}", locations.size());

final List<Location> lsp4jLocations = locations.stream()
.map(location -> Lsp4jConversion.locationToLsp4j(location))
.map(Lsp4jConversion::locationToLsp4j)
.collect(Collectors.toList());
return Either.forLeft(lsp4jLocations);
});
Expand All @@ -370,7 +370,7 @@ public CompletableFuture<List<? extends Location>> references(final ReferencePar
this.referencesProvider.provideReferences(magikFile, position);
LOGGER.debug("References found: {}", locations.size());
return locations.stream()
.map(location -> Lsp4jConversion.locationToLsp4j(location))
.map(Lsp4jConversion::locationToLsp4j)
.collect(Collectors.toList());
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ private Set<MagikTypedCheck> createTypedChecks() {
final Set<Parameter> parameters = Collections.emptySet();
final MagikCheckHolder holder =
new MagikCheckHolder((Class<MagikCheck>) checkClass, parameters, true);
final MagikTypedCheck magikCheck = (MagikTypedCheck) holder.createCheck();
return magikCheck;
return (MagikTypedCheck) holder.createCheck();
} catch (final ReflectiveOperationException exception) {
LOGGER.error(exception.getMessage(), exception);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ private List<Location> implementionsForMethod(final MagikTypedFile magikFile, fi
.filter(anyType -> anyType != type)
.filter(anyType -> anyType.isKindOf(type))
.flatMap(anyType -> anyType.getLocalMethods(methodName).stream())
.map(method -> method.getLocation())
.map(Method::getLocation)
.filter(Objects::nonNull)
.collect(Collectors.toList());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* Test DefinitionsProvider.
*/
@SuppressWarnings("checkstyle:MagicNumber")
public class DefinitionsProviderTest {
class DefinitionsProviderTest {

private static final URI TEST_URI = URI.create("tests://unittest");
private static final Location EMPTY_LOCATION = new Location(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* Test SelectionRangeProvider.
*/
@SuppressWarnings("checkstyle:MagicNumber")
public class SelectionRangeProviderTest {
class SelectionRangeProviderTest {

private List<SelectionRange> getSelectionRanges(
final String code,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,9 @@ public void run(final MagikFile magikFile) throws ReflectiveOperationException,
final URI uri = magikFile.getUri();
final Path magikFilePath = Path.of(uri);
final Path configPath = ConfigurationLocator.locateConfiguration(magikFilePath);
final MagikChecksConfiguration checksConfig = new MagikChecksConfiguration(configPath);
final MagikChecksConfiguration checksConfig = configPath != null
? new MagikChecksConfiguration(configPath)
: new MagikChecksConfiguration();
final Iterable<MagikCheckHolder> holders = checksConfig.getAllChecks();
final Comparator<MagikIssue> byLine = Comparator.comparing(MagikIssue::startLine);
final Comparator<MagikIssue> byColumn = Comparator.comparing(MagikIssue::startColumn);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package nl.ramsolutions.sw;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Path;
Expand Down Expand Up @@ -31,7 +30,7 @@ public MagikToolsProperties() throws IOException {
LOGGER.debug("Read default configuration from: {}", DEFAULT_PROPERTIES_FILENAME);
}

public MagikToolsProperties(final Path path) throws FileNotFoundException, IOException {
public MagikToolsProperties(final Path path) throws IOException {
this(new FileInputStream(path.toFile()));
LOGGER.debug("Read configuration from: {}", path.toAbsolutePath());
}
Expand Down

0 comments on commit 2226216

Please sign in to comment.