Skip to content

Commit ea11347

Browse files
authored
Merge pull request #235 from NASA-AMMOS/231-convert-to-poetry
Add poetry and pre-commit
2 parents f2be352 + b6caa64 commit ea11347

23 files changed

+1049
-35
lines changed

.pre-commit-config.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
repos:
2+
3+
- repo: https://github.com/pre-commit/pre-commit-hooks
4+
rev: v4.0.1
5+
hooks:
6+
- id: trailing-whitespace
7+
- id: end-of-file-fixer
8+
- id: check-merge-conflict
9+
10+
- repo: local
11+
hooks:
12+
- id: tests
13+
name: Tests
14+
entry: 'npm test --prefix ait/gui/static'
15+
language: system
16+
stages: [push]
17+
pass_filenames: false

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
language: node_js
22
node_js:
33
- "node"
4-
4+
55
before_install:
66
- cd ait/gui/static
77

ait/gui/openmct_adapter/ait_integration.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,11 @@ function AITIntegration() {
113113
namespace: 'taxonomy',
114114
key: 'spacecraft'
115115
});
116-
116+
117117
openmct.objects.addProvider('taxonomy', objectProvider);
118-
118+
119119
openmct.composition.addProvider(compositionProvider);
120-
120+
121121
openmct.types.addType('telemetry', {
122122
name: 'Telemetry Point',
123123
description: 'Spacecraft Telemetry point',
@@ -135,14 +135,14 @@ function AITHistoricalTelemetryPlugin() {
135135
request: function (domainObject, options) {
136136
let url = '/history/' + domainObject.identifier.key +
137137
'?start=' + options.start + '&end=' + options.end;
138-
138+
139139
return http.get(url)
140140
.then(function (resp) {
141141
return resp.data
142142
});
143143
}
144144
};
145-
145+
146146
openmct.telemetry.addProvider(provider);
147147
}
148148
};
@@ -152,7 +152,7 @@ function AITRealtimeTelemetryPlugin() {
152152
let socket = new WebSocket(
153153
'ws://' + AIT_HOST + ':' + AIT_PORT + '/tlm/realtime/openmct');
154154
let listener = {};
155-
155+
156156
socket.onmessage = function (event) {
157157
let now = Date.now()
158158

@@ -170,7 +170,7 @@ function AITRealtimeTelemetryPlugin() {
170170
}
171171
}
172172
};
173-
173+
174174
let provider = {
175175
supportsSubscribe: function (domainObject) {
176176
return domainObject.type === 'telemetry';
@@ -182,7 +182,7 @@ function AITRealtimeTelemetryPlugin() {
182182
};
183183
}
184184
};
185-
185+
186186
openmct.telemetry.addProvider(provider);
187187
}
188188
};

ait/gui/static/build/0292d248d009b01cf97cefdfa39c3cf3.svg

Lines changed: 1 addition & 1 deletion
Loading

ait/gui/static/css/ait/gui/Playback.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ ait-playback .controls {
3131

3232
ait-playback .col-xs-3 {
3333
padding-left: 0;
34-
}
34+
}

ait/gui/static/css/ait/gui/TabSet.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,3 @@ ait-tabset ul.nav-stacked li.drag-over-after {
5454
padding-right: 0;
5555
padding-bottom: 4em;
5656
}
57-

ait/gui/static/fonts/fontawesome-webfont.svg

Lines changed: 1 addition & 1 deletion
Loading

ait/gui/static/fonts/glyphicons-halflings-regular.svg

Lines changed: 1 addition & 1 deletion
Loading

ait/gui/static/js/ait/events.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class EventBus
3535
const listeners = this._listeners[event]
3636
const index = listeners && listeners.indexOf(fn)
3737
const found = index !== undefined && index !== -1
38-
38+
3939
if (found) {
4040
listeners.splice(index, 1)
4141
}

ait/gui/static/js/ait/format.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ function time (obj, { h24 = true, gps = true, utc = false } = {}) {
105105
} else {
106106
hh = time.getHours()
107107
mm = time.getMinutes()
108-
ss = time.getSeconds()
108+
ss = time.getSeconds()
109109
}
110110

111111
if (!h24 && hh > 12) {
@@ -127,7 +127,7 @@ function tz (obj, { utc = false, gps = true, local = false } = {}) {
127127
if (gps) {
128128
return 'GPS'
129129
} else if (utc) {
130-
return 'UTC'
130+
return 'UTC'
131131
} else if (local) {
132132
return 'Local Time'
133133
} else {

ait/gui/static/js/ait/gui/Clock.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import * as format from 'ait/format'
2121
* AIT Clock UI Widget
2222
*
2323
* The AIT Clock UI Widget displays a clock with date and time that
24-
* updates every second. The display is configurable at initialization
24+
* updates every second. The display is configurable at initialization
2525
* time or by clicking on specific parts of the time / date display.
2626
*
2727
* Configurable / Toggleable options include:

ait/gui/static/js/ait/gui/Command.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ const CommandInput = {
241241
if (e.keyCode == 17) {
242242
this._cntrl_toggled = true
243243
}
244-
244+
245245
// Cancel submission if
246246
// - Enter was pressed without pressing Ctrl
247247
// - Enter + Ctrl was pressed but the command isn't valid
@@ -485,7 +485,7 @@ const CommandConfigure = {
485485
_cmding_disabled: false,
486486
_cmd_valid: false,
487487
_validating: false,
488-
488+
489489
// We need to keep track of the selected command state for initial command
490490
// validation so we can handle commands that are always valid (commands
491491
// with no arguments or only enumerated values).

ait/gui/static/js/ait/gui/Field.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ const Field =
137137
if ('upper' in this._limits && 'error' in this._limits.upper) {
138138
isError = value > this._limits.upper.error
139139
}
140-
140+
141141
if ('lower' in this._limits && 'error' in this._limits.lower) {
142142
isError = value < this._limits.lower.error || isError
143143
}
@@ -159,7 +159,7 @@ const Field =
159159
} else {
160160
if ('upper' in this._limits && 'warn' in this._limits.upper) {
161161
isWarning = value > this._limits.upper.warn
162-
}
162+
}
163163

164164
if ('lower' in this._limits && 'warn' in this._limits.lower) {
165165
isWarning = value < this._limits.lower.warn || isWarning
@@ -292,7 +292,7 @@ const Field =
292292
},
293293

294294
onbeforeupdate (vnode, old) {
295-
return this.hasChanged()
295+
return this.hasChanged()
296296
},
297297

298298
view (vnode) {
@@ -365,7 +365,7 @@ const Field =
365365
dname = vnode.attrs.display_name + ': '
366366
}
367367

368-
return m('ait-field', vnode.attrs, [m('name', dname),
368+
return m('ait-field', vnode.attrs, [m('name', dname),
369369
m('value', value)])
370370
}
371371
}

ait/gui/static/js/ait/gui/Script.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ const Scripts = {
510510
ait.events.on('script:resume', (e) => {
511511
ScriptsState.execState = 'running'
512512
})
513-
513+
514514
ait.events.on('script:loaded', (e) => {
515515
ScriptsState.execState = 'stopped'
516516
this._script_load_toggle = !this._script_load_toggle

ait/gui/static/js/ait/gui/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ function createMithrilNode (elem) {
106106
return node
107107
}
108108

109-
109+
110110
function makeMithrilNode(e) {
111111
if (e === undefined || e.tag === undefined) {
112112
return e

ait/gui/static/js/ait/packets.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class PacketBuffer
4747
* @return the underlying circular _buffer index for n.
4848
*/
4949
_index (n) {
50-
50+
5151
return (this._start + this._length + n) % this._buffer.length
5252
}
5353

@@ -84,7 +84,7 @@ class PacketBuffer
8484
* Inserts a packet into this PacketBuffer, removing the oldest
8585
* packet, if the buffer is at capacity.
8686
*/
87-
insert (packet) {
87+
insert (packet) {
8888
if ((this._length + 1) > this._buffer.length) {
8989
this.remove()
9090
}
@@ -123,7 +123,7 @@ class PacketBuffers
123123
{
124124
create (name, capacity = 600) {
125125
let created = false
126-
126+
127127
if (this[name] === undefined) {
128128
this[name] = new PacketBuffer(capacity)
129129
created = true
@@ -132,7 +132,7 @@ class PacketBuffers
132132
return created
133133
}
134134

135-
135+
136136
insert (name, packet) {
137137
if (this[name] === undefined) {
138138
this.create(name)

ait/gui/static/js/ait/time.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ function DOY (year, month, day) {
2929

3030
/**
3131
* @returns true if year is a leap year, false otherwise.
32-
*/
32+
*/
3333
function isLeap (year) {
3434
return ((year % 4 === 0) && (year % 100 !== 0)) || (year % 400 === 0)
3535
}

ait/gui/static/overrides.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
* Each class sets a background color for a message of a given
2727
* severity when it is displayed in the ait-messages component.
2828
*
29-
* E.g.,
29+
* E.g.,
3030
* "ait-messages .entry--critical" sets the background color
3131
* for a "critical" message.
3232
*

ait/gui/static/test/mocha.opts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
--compilers js:babel-core/register
22
-r jsdom-global/register
3-

doc/source/ait_gui.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,3 @@ You can send example telemetry data to the GUI for testing using **ait_tlm_send.
5050
$ ait-tlm-send /path/to/sometestdata.pcap
5151
5252
You will need to ensure that the **tlm.yaml** used when generating the example PCAP data matches the **tlm.yaml** you're using when running **ait_tlm_send**, otherwise you will end up with data that looks odd in the UI.
53-

doc/source/index.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,3 @@ Indices and tables
2020
* :ref:`genindex`
2121
* :ref:`modindex`
2222
* :ref:`search`
23-

0 commit comments

Comments
 (0)