Browse Source

Prettify just the committed regions using precise-commits

Jason Grout 6 years ago
parent
commit
e8abd8c005

+ 2 - 6
packages/apputils/src/clientsession.tsx

@@ -1,13 +1,9 @@
 // Copyright (c) Jupyter Development Team.
 // Distributed under the terms of the Modified BSD License.
 
-import {
-  PathExt
-} from '@jupyterlab/coreutils';
+import { PathExt } from '@jupyterlab/coreutils';
 
-import {
-  UUID
-} from '@phosphor/coreutils';
+import { UUID } from '@phosphor/coreutils';
 
 import {
   Kernel, KernelMessage, ServerConnection, Session

+ 1 - 3
packages/apputils/src/mainareawidget.ts

@@ -1,9 +1,7 @@
 // Copyright (c) Jupyter Development Team.
 // Distributed under the terms of the Modified BSD License.
 
-import {
-  UUID
-} from '@phosphor/coreutils';
+import { UUID } from '@phosphor/coreutils';
 
 import {
   Message

+ 2 - 6
packages/cells/src/model.ts

@@ -19,13 +19,9 @@ import {
   CodeEditor
 } from '@jupyterlab/codeeditor';
 
-import {
-  IChangedArgs, nbformat
-} from '@jupyterlab/coreutils';
+import { IChangedArgs, nbformat } from '@jupyterlab/coreutils';
 
-import {
-    UUID
-} from '@phosphor/coreutils';
+import { UUID } from '@phosphor/coreutils';
 
 import {
   IObservableJSON, IModelDB, IObservableValue, ObservableValue

+ 1 - 3
packages/codemirror/src/editor.ts

@@ -27,9 +27,7 @@ import {
   CodeEditor
 } from '@jupyterlab/codeeditor';
 
-import {
-  UUID
-} from '@phosphor/coreutils';
+import { UUID } from '@phosphor/coreutils';
 
 import {
   IObservableMap, IObservableString, ICollaborator

+ 2 - 6
packages/console/src/panel.ts

@@ -9,13 +9,9 @@ import {
   IEditorMimeTypeService
 } from '@jupyterlab/codeeditor';
 
-import {
-  PathExt, Time
-} from '@jupyterlab/coreutils';
+import { PathExt, Time } from '@jupyterlab/coreutils';
 
-import {
-  UUID
-} from '@phosphor/coreutils';
+import { UUID } from '@phosphor/coreutils';
 
 import {
   RenderMimeRegistry

+ 1 - 3
packages/docmanager/src/manager.ts

@@ -6,9 +6,7 @@ import {
   IClientSession
 } from '@jupyterlab/apputils';
 
-import {
-  UUID
-} from '@phosphor/coreutils';
+import { UUID } from '@phosphor/coreutils';
 
 
 import {

+ 5 - 4
packages/notebook-extension/src/index.ts

@@ -18,12 +18,13 @@ import {
 } from '@jupyterlab/codeeditor';
 
 import {
-  ISettingRegistry, IStateDB, PageConfig, URLExt
+  ISettingRegistry,
+  IStateDB,
+  PageConfig,
+  URLExt
 } from '@jupyterlab/coreutils';
 
-import {
-  UUID
-} from '@phosphor/coreutils';
+import { UUID } from '@phosphor/coreutils';
 
 import  {
   IFileBrowserFactory

+ 2 - 6
packages/notebook/src/model.ts

@@ -10,13 +10,9 @@ import {
   CodeCellModel, RawCellModel, MarkdownCellModel, CellModel
 } from '@jupyterlab/cells';
 
-import {
-  nbformat
-} from '@jupyterlab/coreutils';
+import { nbformat } from '@jupyterlab/coreutils';
 
-import {
-  UUID
-} from '@phosphor/coreutils';
+import { UUID } from '@phosphor/coreutils';
 
 import {
   IObservableJSON, IObservableUndoableList,

+ 8 - 8
packages/services/src/kernel/default.ts

@@ -1,13 +1,9 @@
 // Copyright (c) Jupyter Development Team.
 // Distributed under the terms of the Modified BSD License.
 
-import {
-  URLExt
-} from '@jupyterlab/coreutils';
+import { URLExt } from '@jupyterlab/coreutils';
 
-import {
-  UUID
-} from '@phosphor/coreutils';
+import { UUID } from '@phosphor/coreutils';
 
 import {
   ArrayExt, each, find
@@ -77,7 +73,8 @@ class DefaultKernel implements Kernel.IKernel {
   constructor(options: Kernel.IOptions, id: string) {
     this._name = options.name;
     this._id = id;
-    this.serverSettings = options.serverSettings || ServerConnection.makeSettings();
+    this.serverSettings =
+      options.serverSettings || ServerConnection.makeSettings();
     this._clientId = options.clientId || UUID.uuid4();
     this._username = options.username || '';
     this._futures = new Map<string, KernelFutureHandler>();
@@ -596,7 +593,10 @@ class DefaultKernel implements Kernel.IKernel {
    * #### Notes
    * If a client-side comm already exists with the given commId, it is returned.
    */
-  connectToComm(targetName: string, commId: string = UUID.uuid4()): Kernel.IComm {
+  connectToComm(
+    targetName: string,
+    commId: string = UUID.uuid4()
+  ): Kernel.IComm {
     if (this._comms.has(commId)) {
       return this._comms.get(commId);
     }

+ 2 - 6
packages/services/src/kernel/messages.ts

@@ -1,13 +1,9 @@
 // Copyright (c) Jupyter Development Team.
 // Distributed under the terms of the Modified BSD License.
 
-import {
-  nbformat
-} from '@jupyterlab/coreutils';
+import { nbformat } from '@jupyterlab/coreutils';
 
-import {
-  UUID
-} from '@phosphor/coreutils';
+import { UUID } from '@phosphor/coreutils';
 
 
 import {

+ 64 - 23
packages/services/test/src/config/config.spec.ts

@@ -3,9 +3,7 @@
 
 import expect = require('expect.js');
 
-import {
-  UUID
-} from '@phosphor/coreutils';
+import { UUID } from '@phosphor/coreutils';
 
 import {
   JSONObject
@@ -32,7 +30,10 @@ describe('config', () => {
 
     it('should accept server settings', () => {
       let serverSettings = makeSettings();
-      return ConfigSection.create({ name: UUID.uuid4(), serverSettings }).then(config => {
+      return ConfigSection.create({
+        name: UUID.uuid4(),
+        serverSettings
+      }).then(config => {
         expect(Object.keys(config.data).length).to.be(0);
       });
     });
@@ -40,7 +41,10 @@ describe('config', () => {
 
     it('should fail for an incorrect response', (done) => {
       let serverSettings = getRequestHandler(201, { });
-      let configPromise = ConfigSection.create({ name: UUID.uuid4(), serverSettings });
+      let configPromise = ConfigSection.create({
+        name: UUID.uuid4(),
+        serverSettings
+      });
       expectFailure(configPromise, done, 'Invalid response: 201 Created');
     });
 
@@ -50,7 +54,8 @@ describe('config', () => {
 
     it('should update a config', () => {
       let config: IConfigSection;
-      return ConfigSection.create({ name: UUID.uuid4() }).then(c => {
+      return ConfigSection.create({ name: UUID.uuid4() })
+        .then(c => {
         config = c;
         return config.update( { foo: 'baz', spam: 'eggs' });
       }).then((data: any) => {
@@ -64,7 +69,8 @@ describe('config', () => {
     it('should accept server settings', () => {
       let config: IConfigSection;
       let serverSettings = makeSettings();
-      return ConfigSection.create({ name: UUID.uuid4(), serverSettings }).then(c => {
+      return ConfigSection.create({ name: UUID.uuid4(), serverSettings })
+        .then(c => {
         config = c;
         return config.update( { foo: 'baz', spam: 'eggs' });
       }).then((data: any) => {
@@ -76,8 +82,9 @@ describe('config', () => {
     });
 
     it('should fail for an incorrect response', (done) => {
-      ConfigSection.create({ name: UUID.uuid4() }).then(config => {
-        handleRequest(config, 201, { });
+      ConfigSection.create({ name: UUID.uuid4() })
+        .then(config => {
+          handleRequest(config, 201, {});
         let update = config.update({ foo: 'baz' });
         expectFailure(update, done, 'Invalid response: 201 Created');
       }).catch(done);
@@ -95,8 +102,14 @@ describe('jupyter.services - ConfigWithDefaults', () => {
     it('should complete properly', () => {
       let defaults: JSONObject = { spam: 'eggs' };
       let className = 'testclass';
-      return ConfigSection.create({ name: UUID.uuid4() }).then(section => {
-        let config = new ConfigWithDefaults({ section, defaults, className });
+      return ConfigSection.create({
+        name: UUID.uuid4()
+      }).then(section => {
+        let config = new ConfigWithDefaults({
+          section,
+          defaults,
+          className
+        });
         expect(config).to.be.a(ConfigWithDefaults);
       });
     });
@@ -108,8 +121,14 @@ describe('jupyter.services - ConfigWithDefaults', () => {
     it('should get a new config value', () => {
       let defaults: JSONObject = { foo: 'bar' };
       let className = 'testclass';
-      return ConfigSection.create({ name: UUID.uuid4() }).then(section => {
-        let config = new ConfigWithDefaults({ section, defaults, className });
+      return ConfigSection.create({
+        name: UUID.uuid4()
+      }).then(section => {
+        let config = new ConfigWithDefaults({
+          section,
+          defaults,
+          className
+        });
         let data = config.get('foo');
         expect(data).to.be('bar');
       });
@@ -118,8 +137,14 @@ describe('jupyter.services - ConfigWithDefaults', () => {
     it('should get a default config value', () => {
       let defaults: JSONObject = { spam: 'eggs' };
       let className = 'testclass';
-      return ConfigSection.create({ name: UUID.uuid4() }).then(section => {
-        let config = new ConfigWithDefaults({ section, defaults, className });
+      return ConfigSection.create({
+        name: UUID.uuid4()
+      }).then(section => {
+        let config = new ConfigWithDefaults({
+          section,
+          defaults,
+          className
+        });
         let data = config.get('spam');
         expect(data).to.be('eggs');
       });
@@ -128,8 +153,14 @@ describe('jupyter.services - ConfigWithDefaults', () => {
     it('should get a default config value with no class', () => {
       let defaults: JSONObject = { spam: 'eggs' };
       let className = 'testclass';
-      return ConfigSection.create({ name: UUID.uuid4() }).then(section => {
-        let config = new ConfigWithDefaults({ section, defaults, className });
+      return ConfigSection.create({
+        name: UUID.uuid4()
+      }).then(section => {
+        let config = new ConfigWithDefaults({
+          section,
+          defaults,
+          className
+        });
         let data = config.get('spam');
         expect(data).to.be('eggs');
       });
@@ -139,8 +170,15 @@ describe('jupyter.services - ConfigWithDefaults', () => {
       let defaults: JSONObject = { foo: true };
       let className = 'testclass';
       let serverSettings = getRequestHandler(200, {foo: false });
-      return ConfigSection.create({ name: UUID.uuid4(), serverSettings }).then(section => {
-        let config = new ConfigWithDefaults({ section, defaults, className });
+      return ConfigSection.create({
+        name: UUID.uuid4(),
+        serverSettings
+      }).then(section => {
+        let config = new ConfigWithDefaults({
+          section,
+          defaults,
+          className
+        });
         let data = config.get('foo');
         expect(data).to.not.be.ok();
       });
@@ -153,7 +191,8 @@ describe('jupyter.services - ConfigWithDefaults', () => {
     it('should set a value in a class immediately', () => {
       let className = 'testclass';
       let section: IConfigSection;
-      return ConfigSection.create({ name: UUID.uuid4() }).then(s => {
+      return ConfigSection.create({ name: UUID.uuid4() })
+        .then(s => {
         section = s;
         let config = new ConfigWithDefaults({ section, className });
         return config.set('foo', 'bar');
@@ -165,7 +204,8 @@ describe('jupyter.services - ConfigWithDefaults', () => {
 
     it('should set a top level value', () => {
       let section: IConfigSection;
-      return ConfigSection.create({ name: UUID.uuid4() }).then(s => {
+      return ConfigSection.create({ name: UUID.uuid4() })
+        .then(s => {
         section = s;
         let config = new ConfigWithDefaults({ section });
         let set = config.set('foo', 'bar');
@@ -179,8 +219,9 @@ describe('jupyter.services - ConfigWithDefaults', () => {
 
     it('should fail for an invalid response', (done) => {
       let serverSettings = getRequestHandler(200, {});
-      ConfigSection.create({ name: UUID.uuid4(), serverSettings }).then(section => {
-        handleRequest(section, 201, {foo: 'bar'});
+      ConfigSection.create({ name: UUID.uuid4(), serverSettings })
+        .then(section => {
+          handleRequest(section, 201, { foo: 'bar'});
         let config = new ConfigWithDefaults({ section });
         let set = config.set('foo', 'bar');
         expect(section.data['foo']).to.be('bar');

+ 6 - 7
packages/services/test/src/kernel/ikernel.spec.ts

@@ -3,13 +3,9 @@
 
 import expect = require('expect.js');
 
-import {
-  PageConfig
-} from '@jupyterlab/coreutils';
+import { PageConfig } from '@jupyterlab/coreutils';
 
-import {
-  UUID
-} from '@phosphor/coreutils';
+import { UUID } from '@phosphor/coreutils';
 
 import {
   JSONObject, PromiseDelegate
@@ -709,7 +705,10 @@ describe('Kernel.IKernel', () => {
     });
 
     it('should throw an error for an invalid response', async () => {
-      handleRequest(defaultKernel, 200, { id: UUID.uuid4(), name: 'foo' });
+      handleRequest(defaultKernel, 200, {
+        id: UUID.uuid4(),
+        name: 'foo'
+      });
       let shutdown = defaultKernel.shutdown();
       await expectFailure(shutdown, null, 'Invalid response: 200 OK');
     });

+ 5 - 4
packages/services/test/src/kernel/kernel.spec.ts

@@ -3,9 +3,7 @@
 
 import expect = require('expect.js');
 
-import {
-  UUID
-} from '@phosphor/coreutils';
+import { UUID } from '@phosphor/coreutils';
 
 
 import {
@@ -135,7 +133,10 @@ describe('kernel', () => {
     });
 
     it('should throw an error for another invalid kernel id', (done) => {
-      let serverSettings = getRequestHandler(201, { id: UUID.uuid4(), name: 1 });
+      let serverSettings = getRequestHandler(201, {
+        id: UUID.uuid4(),
+        name: 1
+      });
       let kernelPromise = Kernel.startNew({ serverSettings });
       expectFailure(kernelPromise, done);
     });

+ 9 - 8
packages/services/test/src/session/manager.spec.ts

@@ -3,9 +3,7 @@
 
 import expect = require('expect.js');
 
-import {
-  UUID
-} from '@phosphor/coreutils';
+import { UUID } from '@phosphor/coreutils';
 
 import {
   toArray
@@ -173,11 +171,14 @@ describe('session/manager', () => {
           manager.dispose();
           called = true;
         });
-        return session.setPath(UUID.uuid4()).then(() => {
-          return manager.refreshRunning();
-        }).then(() => {
-          expect(called).to.be(true);
-        });
+        return session
+          .setPath(UUID.uuid4())
+          .then(() => {
+            return manager.refreshRunning();
+          })
+          .then(() => {
+            expect(called).to.be(true);
+          });
       });
 
       it('should be emitted when a session changes kernels', () => {

+ 2 - 6
packages/services/test/src/session/session.spec.ts

@@ -3,13 +3,9 @@
 
 import expect = require('expect.js');
 
-import {
-  PageConfig
-} from '@jupyterlab/coreutils';
+import { PageConfig } from '@jupyterlab/coreutils';
 
-import {
-  UUID
-} from '@phosphor/coreutils';
+import { UUID } from '@phosphor/coreutils';
 
 import {
   toArray

+ 5 - 10
packages/services/test/src/terminal/terminal.spec.ts

@@ -3,13 +3,9 @@
 
 import expect = require('expect.js');
 
-import {
-  PageConfig
-} from '@jupyterlab/coreutils';
+import { PageConfig } from '@jupyterlab/coreutils';
 
-import {
-  UUID
-} from '@phosphor/coreutils';
+import { UUID } from '@phosphor/coreutils';
 
 import {
   Signal
@@ -72,10 +68,9 @@ describe('terminal', () => {
       });
 
       it('should reject if the session does not exist on the server', () => {
-        return TerminalSession.connectTo(UUID.uuid4()).then(
-          () => { throw Error('should not get here'); },
-          () => undefined
-        );
+        return TerminalSession.connectTo(UUID.uuid4()).then(() => {
+          throw Error('should not get here');
+        }, () => undefined);
       });
 
     });

+ 5 - 5
packages/services/test/src/utils.ts

@@ -7,9 +7,7 @@ import WebSocket from 'ws';
 
 import expect from 'expect.js';
 
-import {
-  UUID
-} from '@phosphor/coreutils';
+import { UUID } from '@phosphor/coreutils';
 
 import {
   JSONObject, JSONPrimitive, PromiseDelegate
@@ -504,7 +502,6 @@ class KernelTester extends SocketTester {
   }
 
   readonly serverSessionId = UUID.uuid4();
-
   private _initialStatus = 'starting';
   private _kernel: Kernel.IKernel | null = null;
   private _onMessage: (msg: KernelMessage.IMessage) => void = null;
@@ -548,7 +545,10 @@ class SessionTester extends SocketTester {
   async startSession(): Promise<Session.ISession> {
     handleRequest(this, 201, createSessionModel());
     let serverSettings = this.serverSettings;
-    this._session = await Session.startNew({ path: UUID.uuid4(), serverSettings });
+    this._session = await Session.startNew({
+      path: UUID.uuid4(),
+      serverSettings
+    });
     await this.ready;
     await this._session.kernel.ready;
     return this._session;

+ 14 - 12
tests/test-apputils/src/clientsession.spec.ts

@@ -11,9 +11,7 @@ import {
   ClientSession, IClientSession
 } from '@jupyterlab/apputils';
 
-import {
-  UUID
-} from '@phosphor/coreutils';
+import { UUID } from '@phosphor/coreutils';
 
 import {
   acceptDialog, dismissDialog
@@ -250,16 +248,20 @@ describe('@jupyterlab/apputils', () => {
       it('should connect to an existing kernel', () => {
         let other: Session.ISession;
         session.dispose();
-        return manager.startNew({ path: UUID.uuid4() }).then(o => {
-          other = o;
-          session = new ClientSession({
-            manager, kernelPreference: { id: other.kernel.id }
+        return manager
+          .startNew({ path: UUID.uuid4() })
+          .then(o => {
+            other = o;
+            session = new ClientSession({
+              manager,
+              kernelPreference: { id: other.kernel.id }
+            });
+            return session.initialize();
+          })
+          .then(() => {
+            expect(session.kernel.id).to.be(other.kernel.id);
+            return other.dispose();
           });
-          return session.initialize();
-        }).then(() => {
-          expect(session.kernel.id).to.be(other.kernel.id);
-          return other.dispose();
-        });
       });
 
       it('should present a dialog if there is no distinct kernel to start', () => {

+ 1 - 3
tests/test-console/src/foreign.spec.ts

@@ -3,9 +3,7 @@
 
 import expect = require('expect.js');
 
-import {
-  UUID
-} from '@phosphor/coreutils';
+import { UUID } from '@phosphor/coreutils';
 
 import {
   KernelMessage, Session

+ 1 - 3
tests/test-csvviewer/src/widget.spec.ts

@@ -3,9 +3,7 @@
 
 import expect = require('expect.js');
 
-import {
-  UUID
-} from '@phosphor/coreutils';
+import { UUID } from '@phosphor/coreutils';
 
 import {
   ServiceManager

+ 6 - 4
tests/test-docmanager/src/savehandler.spec.ts

@@ -3,9 +3,7 @@
 
 import expect = require('expect.js');
 
-import {
-  UUID
-} from '@phosphor/coreutils';
+import { UUID } from '@phosphor/coreutils';
 
 import {
   ServiceManager
@@ -37,7 +35,11 @@ describe('docregistry/savehandler', () => {
   });
 
   beforeEach(() => {
-    context = new Context({ manager, factory, path: UUID.uuid4() + '.txt' });
+    context = new Context({
+      manager,
+      factory,
+      path: UUID.uuid4() + '.txt'
+    });
     handler = new SaveHandler({ context });
     return context.initialize(true);
   });

+ 1 - 3
tests/test-docmanager/src/widgetmanager.spec.ts

@@ -3,9 +3,7 @@
 
 import expect = require('expect.js');
 
-import {
-  UUID
-} from '@phosphor/coreutils';
+import { UUID } from '@phosphor/coreutils';
 
 import {
   ServiceManager

+ 17 - 6
tests/test-docregistry/src/context.spec.ts

@@ -3,9 +3,7 @@
 
 import expect = require('expect.js');
 
-import {
-  UUID
-} from '@phosphor/coreutils';
+import { UUID } from '@phosphor/coreutils';
 
 import {
   Contents, ServiceManager
@@ -48,7 +46,11 @@ describe('docregistry/context', () => {
     let context: Context<DocumentRegistry.IModel>;
 
     beforeEach(() => {
-      context = new Context({ manager, factory, path: UUID.uuid4() + '.txt' });
+      context = new Context({
+        manager,
+        factory,
+        path: UUID.uuid4() + '.txt'
+      });
     });
 
     afterEach(() => {
@@ -60,7 +62,11 @@ describe('docregistry/context', () => {
     describe('#constructor()', () => {
 
       it('should create a new context', () => {
-        context = new Context({ manager, factory, path: UUID.uuid4() + '.txt' });
+        context = new Context({
+          manager,
+          factory,
+          path: UUID.uuid4() + '.txt'
+        });
         expect(context).to.be.a(Context);
       });
 
@@ -431,7 +437,12 @@ describe('docregistry/context', () => {
         let opener = (widget: Widget) => {
           called = true;
         };
-        context = new Context({ manager, factory, path: UUID.uuid4() + '.txt', opener });
+        context = new Context({
+          manager,
+          factory,
+          path: UUID.uuid4() + '.txt',
+          opener
+        });
         context.addSibling(new Widget());
         expect(called).to.be(true);
       });

+ 1 - 3
tests/test-docregistry/src/registry.spec.ts

@@ -3,9 +3,7 @@
 
 import expect = require('expect.js');
 
-import {
-  UUID
-} from '@phosphor/coreutils';
+import { UUID } from '@phosphor/coreutils';
 
 
 import {

+ 2 - 6
tests/test-filebrowser/src/model.spec.ts

@@ -3,13 +3,9 @@
 
 import expect = require('expect.js');
 
-import {
-  StateDB, PageConfig
-} from '@jupyterlab/coreutils';
+import { StateDB, PageConfig } from '@jupyterlab/coreutils';
 
-import {
-  UUID
-} from '@phosphor/coreutils';
+import { UUID } from '@phosphor/coreutils';
 
 import {
   DocumentManager, IDocumentManager

+ 1 - 3
tests/test-fileeditor/src/widget.spec.ts

@@ -15,9 +15,7 @@ import {
   simulate
 } from 'simulate-event';
 
-import {
-  UUID
-} from '@phosphor/coreutils';
+import { UUID } from '@phosphor/coreutils';
 
 import {
   ServiceManager

+ 2 - 4
tests/test-imageviewer/src/widget.spec.ts

@@ -3,9 +3,7 @@
 
 import expect = require('expect.js');
 
-import {
-  UUID
-} from '@phosphor/coreutils';
+import { UUID } from '@phosphor/coreutils';
 
 import {
   Contents, ServiceManager
@@ -100,7 +98,7 @@ describe('ImageViewer', () => {
     });
 
     it('should keep the title in sync with the file name', (done) => {
-      let newPath = (IMAGE as any).path = UUID.uuid4() + '.png';
+      let newPath = ((IMAGE as any).path = UUID.uuid4() + '.png');
       expect(widget.title.label).to.be(context.path);
       context.pathChanged.connect(() => {
         expect(widget.title.label).to.be(newPath);

+ 1 - 3
tests/test-rendermime/src/registry.spec.ts

@@ -3,9 +3,7 @@
 
 import expect = require('expect.js');
 
-import {
-  UUID
-} from '@phosphor/coreutils';
+import { UUID } from '@phosphor/coreutils';
 
 import {
   Contents, Drive, ServiceManager, Session

+ 2 - 6
tests/utils.ts

@@ -18,13 +18,9 @@ import {
   ClientSession
 } from '@jupyterlab/apputils';
 
-import {
-  nbformat
-} from '@jupyterlab/coreutils';
+import { nbformat } from '@jupyterlab/coreutils';
 
-import {
-  UUID
-} from '@phosphor/coreutils';
+import { UUID } from '@phosphor/coreutils';
 
 import {
   TextModelFactory, DocumentRegistry, Context