Skip to content

Commit

Permalink
fix: Indentation warnings from EditorConfig lint.
Browse files Browse the repository at this point in the history
Signed-off-by: jefft0 <jeff@thefirst.org>
  • Loading branch information
jefft0 committed Sep 6, 2022
1 parent 640c556 commit 19dab7a
Show file tree
Hide file tree
Showing 10 changed files with 79 additions and 79 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ protected void onActivityResult(int requestCode, int resultCode, Intent data) {

@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] strPerm,
@NonNull int [] grantResults) {
@NonNull int [] grantResults) {
super.onRequestPermissionsResult(requestCode, strPerm, grantResults);

if (grantResults.length > 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,16 @@ public void testNullParams() throws Exception {
} catch (Exception e) { /* ignore */ }


// DNS pair setter tests
try {
IPFS.setDNSPair(null, "foo");
fail("setDNSPair() should fail with a null primary");
} catch (Exception e) { /* ignore */ }

try {
IPFS.setDNSPair("foo", null);
fail("setDNSPair() should fail with a null secondary");
} catch (Exception e) { /* ignore */ }
// DNS pair setter tests
try {
IPFS.setDNSPair(null, "foo");
fail("setDNSPair() should fail with a null primary");
} catch (Exception e) { /* ignore */ }

try {
IPFS.setDNSPair("foo", null);
fail("setDNSPair() should fail with a null secondary");
} catch (Exception e) { /* ignore */ }


// Request tests
Expand Down
26 changes: 13 additions & 13 deletions android/bridge/src/main/java/ipfs/gomobile/android/IPFS.java
Original file line number Diff line number Diff line change
Expand Up @@ -316,14 +316,14 @@ synchronized public RequestBuilder newRequest(@NonNull String command)
}

/**
* Serves node gateway over the given multiaddr
*
* @param multiaddr The multiaddr to listen on
* @param writable If true: will also support support `POST`, `PUT`, and `DELETE` methods.
* @return The MultiAddr the node is serving on
* @throws NodeListenException If the node failed to serve
* @see <a href="https://docs.ipfs.io/concepts/ipfs-gateway/#gateway-providers">IPFS Doc</a>
*/
* Serves node gateway over the given multiaddr
*
* @param multiaddr The multiaddr to listen on
* @param writable If true: will also support support `POST`, `PUT`, and `DELETE` methods.
* @return The MultiAddr the node is serving on
* @throws NodeListenException If the node failed to serve
* @see <a href="https://docs.ipfs.io/concepts/ipfs-gateway/#gateway-providers">IPFS Doc</a>
*/
synchronized public String serveGatewayMultiaddr(@NonNull String multiaddr, @NonNull Boolean writable) throws NodeListenException {
try {
return node.serveGatewayMultiaddr(multiaddr, writable);
Expand All @@ -333,11 +333,11 @@ synchronized public String serveGatewayMultiaddr(@NonNull String multiaddr, @Non
}

/**
* Sets the primary and secondary DNS for gomobile (hacky, will be removed in future version)
*
* @param primary The primary DNS address in the form {@code <ip4>:<port>}
* @param secondary The secondary DNS address in the form {@code <ip4>:<port>}
*/
* Sets the primary and secondary DNS for gomobile (hacky, will be removed in future version)
*
* @param primary The primary DNS address in the form {@code <ip4>:<port>}
* @param secondary The secondary DNS address in the form {@code <ip4>:<port>}
*/
public static void setDNSPair(@NonNull String primary, @NonNull String secondary) {
Objects.requireNonNull(primary, "primary should not be null");
Objects.requireNonNull(secondary, "secondary should not be null");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ public synchronized void StopBleDriver() {
stopBleDriver();
if (mBroadcastReceiverRegistered) {
mAppContext.unregisterReceiver(mBroadcastReceiver);
mBroadcastReceiverRegistered = false;
mBroadcastReceiverRegistered = false;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ public synchronized boolean add(Runnable r, Callback callback,long delay, Runnab
}

/**
* The current command has been completed, move to the next command in the queue (if any)
*/
* The current command has been completed, move to the next command in the queue (if any)
*/
public synchronized void completedCommand(int status) {
mLogger.v(TAG, String.format("id=%s completedCommand called", mLogger.sensitiveObject(mId)));

Expand All @@ -73,8 +73,8 @@ public synchronized void completedCommand(int status) {
}

/**
* Retry the current command. Typically used when a read/write fails and triggers a bonding procedure
*/
* Retry the current command. Typically used when a read/write fails and triggers a bonding procedure
*/
public synchronized void retryCommand() {
// TODO: to implement in driver
mLogger.v(TAG, String.format("id=%s retryCommand called", mLogger.sensitiveObject(mId)));
Expand Down Expand Up @@ -127,10 +127,10 @@ private void cancelTimer() {
}

/**
* Execute the next command in the subscribe queue.
* A queue is used because the calls have to be executed sequentially.
* If the read or write fails, the next command in the queue is executed.
*/
* Execute the next command in the subscribe queue.
* A queue is used because the calls have to be executed sequentially.
* If the read or write fails, the next command in the queue is executed.
*/
public synchronized void nextCommand() {
mLogger.v(TAG, String.format("id=%s nextCommand called", mLogger.sensitiveObject(mId)));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,12 +259,12 @@ public void onCharacteristicReadRequest(BluetoothDevice device,
// have to cut data ourself to fit with MTU.
@Override
public void onCharacteristicWriteRequest(BluetoothDevice device,
int requestId,
BluetoothGattCharacteristic characteristic,
boolean prepareWrite,
boolean responseNeeded,
int offset,
byte[] value) {
int requestId,
BluetoothGattCharacteristic characteristic,
boolean prepareWrite,
boolean responseNeeded,
int offset,
byte[] value) {
super.onCharacteristicWriteRequest(device, requestId, characteristic, prepareWrite,
responseNeeded, offset, value);
mLogger.v(TAG, String.format("onCharacteristicWriteRequest called: device=%s characteristic=%s requestId=%d preparedWrite=%b needResponse=%b", mLogger.sensitiveObject(device.getAddress()), characteristic.getUuid(), requestId, prepareWrite, responseNeeded));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ public void onServicesDiscovered(BluetoothGatt gatt, int status) {

@Override
public void onCharacteristicRead(BluetoothGatt gatt,
BluetoothGattCharacteristic characteristic,
int status) {
BluetoothGattCharacteristic characteristic,
int status) {
super.onCharacteristicRead(gatt, characteristic, status);
mLogger.v(TAG, String.format("onCharacteristicRead: device=%s", mLogger.sensitiveObject(getMACAddress())));

Expand Down Expand Up @@ -198,8 +198,8 @@ public void onCharacteristicRead(BluetoothGatt gatt,

@Override
public void onCharacteristicWrite(BluetoothGatt gatt,
BluetoothGattCharacteristic characteristic,
int status) {
BluetoothGattCharacteristic characteristic,
int status) {
super.onCharacteristicWrite(gatt, characteristic, status);
mLogger.v(TAG, String.format("onCharacteristicWrite for device %s", mLogger.sensitiveObject(getMACAddress())));

Expand Down
18 changes: 9 additions & 9 deletions go/pkg/proximitytransport/mplex.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
package proximitytransport

/*
The mplex struct as NOT relationship with libp2p mplex package!!!
The mplex struct as NOT relationship with libp2p mplex package!!!
This mplex struct is a multiplexer taken multiple inputs for one output.
You must initialize mplex by setting input and output before running it.
There are two types of input:
1) RingBufferMap
2) builtin chan []byte
There is only one type of output: *io.PipeWriter
When you start mplex, its flushed buffers first in the order you set them,
and read on its chan []byte.
This mplex struct is a multiplexer taken multiple inputs for one output.
You must initialize mplex by setting input and output before running it.
There are two types of input:
1) RingBufferMap
2) builtin chan []byte
There is only one type of output: *io.PipeWriter
When you start mplex, its flushed buffers first in the order you set them,
and read on its chan []byte.
*/

import (
Expand Down
10 changes: 5 additions & 5 deletions ios/Example/Example/AttachmentHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ import AVFoundation
import Photos

/*
AttachmentHandler.shared.showAttachmentActionSheet(vc: self)
AttachmentHandler.shared.imagePickedBlock = { (image) in
/* get your image here */
}
*/
AttachmentHandler.shared.showAttachmentActionSheet(vc: self)
AttachmentHandler.shared.imagePickedBlock = { (image) in
/* get your image here */
}
*/



Expand Down
44 changes: 22 additions & 22 deletions ios/Example/Example/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -100,30 +100,30 @@ class ViewController: UIViewController {
print(code)
self.navigationController!.popViewController(animated: true)
DispatchQueue.global(qos: .background).asyncAfter(deadline: .now(), execute: {
var error: String?
var title: String = ""
var image: UIImage = UIImage()
var error: String?
var title: String = ""
var image: UIImage = UIImage()

do {
let fetchedData = try ViewController.ipfs!.newRequest("cat")
.with(argument: code)
.send()
do {
let fetchedData = try ViewController.ipfs!.newRequest("cat")
.with(argument: code)
.send()

title = "IPFS File"
image = UIImage(data: fetchedData)!
} catch let err as IPFSError {
error = err.localizedFullDescription
} catch let err {
error = err.localizedDescription
}
DispatchQueue.main.async {
if let err = error {
self.displayFetchError(err)
} else {
self.displayFetchSuccess(title, image)
}
}
})
title = "IPFS File"
image = UIImage(data: fetchedData)!
} catch let err as IPFSError {
error = err.localizedFullDescription
} catch let err {
error = err.localizedDescription
}
DispatchQueue.main.async {
if let err = error {
self.displayFetchError(err)
} else {
self.displayFetchSuccess(title, image)
}
}
})
}

DispatchQueue.global(qos: .background).async {
Expand Down

0 comments on commit 19dab7a

Please sign in to comment.