Skip to content

Commit

Permalink
Cleanup and formatting
Browse files Browse the repository at this point in the history
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
  • Loading branch information
pditommaso committed Mar 1, 2025
1 parent 0d1a74f commit 34cc0b1
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 22 deletions.
7 changes: 1 addition & 6 deletions modules/nextflow/src/main/groovy/nextflow/cli/CmdCid.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@ class CmdCid extends CmdBase {
commands << new CmdLog()
commands << new CmdShow()
commands << new CmdLineage()


}

@Parameter(hidden = true)
Expand Down Expand Up @@ -115,12 +113,9 @@ class CmdCid extends CmdBase {
.build()
final session = new Session(config)
printHistory(session.cidStore)

}

private void printHistory(CidStore store) {


final historyFile = store.getHistoryFile()
if (historyFile.exists()) {
def table = new TableBuilder(cellSeparator: '\t')
Expand All @@ -140,6 +135,7 @@ class CmdCid extends CmdBase {
println 'Usage: nextflow cid log'
}
}

class CmdShow implements SubCmd{

@Override
Expand Down Expand Up @@ -176,7 +172,6 @@ class CmdCid extends CmdBase {
}
}


class CmdLineage implements SubCmd {

@Canonical
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@ abstract class CidStoreFactory implements ExtensionPoint {
final factory = all.first()
log.debug "Using Nextflow CID store factory: ${factory.getClass().getName()}"
return factory.newInstance(config)


}


}
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,4 @@ class DefaultCidStore implements CidStore {

static Path getMetadataPath(DataConfig config){ config.store.location.resolve('.meta') }


}
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,5 @@ class DefaultCidStoreFactory extends CidStoreFactory{
cidStore.open(config)
return cidStore
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ class CidFileSystem extends FileSystem {
private Path basePath

/*
* Only needed to prevent serialization issues - see https://github.com/nextflow-io/nextflow/issues/5208
*/
* Only needed to prevent serialization issues - see https://github.com/nextflow-io/nextflow/issues/5208
*/
protected CidFileSystem(){}

CidFileSystem(CidFileSystemProvider provider, DataConfig config) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ class CidFileSystemProvider extends FileSystemProvider {

@Override
int read(ByteBuffer dst) throws IOException {
channel.read(dst)
return channel.read(dst)
}

@Override
Expand All @@ -146,7 +146,7 @@ class CidFileSystemProvider extends FileSystemProvider {

@Override
long position() throws IOException {
channel.position()
return channel.position()
}

@Override
Expand All @@ -156,7 +156,7 @@ class CidFileSystemProvider extends FileSystemProvider {

@Override
long size() throws IOException {
channel.size()
return channel.size()
}

@Override
Expand All @@ -166,7 +166,7 @@ class CidFileSystemProvider extends FileSystemProvider {

@Override
boolean isOpen() {
channel.isOpen()
return channel.isOpen()
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ import nextflow.file.FileHelper
@CompileStatic
class CidPath implements Path {

static public String SEPARATOR = '/'
static public final String SEPARATOR = '/'
public static final String METADATA_FILE = '.data.json'
public static final String CID_PROT = "${SCHEME}://".toString()
public static final String CID_PROT = "${SCHEME}://"

static private String[] EMPTY = new String[] {}
static private final String[] EMPTY = new String[] {}

private CidFileSystem fileSystem

Expand Down Expand Up @@ -161,7 +161,6 @@ class CidPath implements Path {
default:
return resolve0(fs, more[0], more[1..-1] as String[])
}

}

static private String norm0(String path) {
Expand Down Expand Up @@ -298,7 +297,6 @@ class CidPath implements Path {
return resolve(that)
}


@Override
Path relativize(Path other) {
if( CidPath.class != other.class ) {
Expand Down Expand Up @@ -384,5 +382,4 @@ class CidPath implements Path {
filePath
}


}

0 comments on commit 34cc0b1

Please sign in to comment.