Skip to content

Commit

Permalink
Merge branch 'ci-pretty'
Browse files Browse the repository at this point in the history
  • Loading branch information
pulsejet committed Oct 14, 2023
2 parents 351515e + 1bc5f58 commit 376fa24
Show file tree
Hide file tree
Showing 51 changed files with 188 additions and 109 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/static-analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
uses: actions/checkout@v3

- name: Install Pretter
run: npm install -g prettier
run: npm install --no-save "prettier@$(cat ./package.json | jq -r '.devDependencies["prettier"]')"

- name: Run Prettier
run: npx prettier src --check
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,7 @@
},
"git.alwaysSignOff": true,
"editor.formatOnSave": true,
"psalm.configPaths": [
"psalm-ls.xml"
],
}
48 changes: 35 additions & 13 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
"@types/url-parse": "^1.4.9",
"@types/videojs-contrib-quality-levels": "^2.0.2",
"playwright": "^1.39.0",
"prettier": "^3.0.3",
"typescript": "^5.2.2",
"workbox-webpack-plugin": "^7.0.0"
}
Expand Down
40 changes: 40 additions & 0 deletions psalm-ls.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?xml version="1.0"?>
<psalm
totallyTyped="true"
errorLevel="5"
resolveFromConfigFile="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
cacheDirectory=".cache/psalm"
>
<!--
Duplication is due to differences in language server and CLI
The CLI needs the files in extraFiles since we specify lib as
the scan directory. The language server needs the files in
projectFiles since it doesn't seem to support extraFiles.
-->
<projectFiles>
<directory name="lib" />
<directory name="../../lib" />
<directory name="../../apps/files/lib/Event" />
<directory name="../../3rdparty/doctrine" />
<directory name="../../3rdparty/psr" />
<directory name="../../3rdparty/guzzlehttp" />

<ignoreFiles>
<directory name="vendor" />
</ignoreFiles>
</projectFiles>
<issueHandlers>
<UndefinedDocblockClass>
<errorLevel type="suppress">
<referencedClass name="Doctrine\DBAL\Schema\Schema" />
<referencedClass name="Doctrine\DBAL\Schema\SchemaException" />
<referencedClass name="Doctrine\DBAL\Driver\Statement" />
<referencedClass name="Doctrine\DBAL\Schema\Table" />
<referencedClass name="Doctrine\DBAL\Platforms\AbstractPlatform" />
</errorLevel>
</UndefinedDocblockClass>
</issueHandlers>
</psalm>
17 changes: 4 additions & 13 deletions psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,14 @@
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
cacheDirectory=".cache/psalm"
>
<!-- The language server works slightly differently and has a different file -->
<projectFiles>
<directory name="lib" />

<!--
Duplication is due to differences in language server and CLI
The CLI needs the files in extraFiles since we specify lib as
the scan directory. The language server needs the files in
projectFiles since it doesn't seem to support extraFiles.
-->
<directory name="../../lib" />
<directory name="../../apps/files/lib/Event" />
<directory name="../../3rdparty/doctrine" />
<directory name="../../3rdparty/psr" />
<directory name="../../3rdparty/guzzlehttp" />

<ignoreFiles>
<directory name="vendor" />
<directory name="../../lib" />
<directory name="../../apps/files" />
<directory name="../../3rdparty" />
</ignoreFiles>
</projectFiles>
<extraFiles>
Expand Down
2 changes: 1 addition & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ export default defineComponent({
this.metadataComponent?.$destroy?.();
this.metadataComponent = null;
},
})
}),
);
// Check for native interface
Expand Down
4 changes: 3 additions & 1 deletion src/components/ScrollerManager.vue
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,9 @@ export default defineComponent({
z-index: 100; // below top-matter and top-bar
cursor: ns-resize;
opacity: 0;
transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;
transition:
opacity 0.2s ease-in-out,
visibility 0.2s ease-in-out;
// Show on hover or scroll of main window
&:hover,
Expand Down
4 changes: 2 additions & 2 deletions src/components/SelectionManager.vue
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ export default defineComponent({
} else {
this.touchScrollDelta = Math.min(
(touch.clientY - _m.window.innerHeight + TOUCH_SELECT_CLAMP.bottom) / 3,
TOUCH_SELECT_CLAMP.maxDelta
TOUCH_SELECT_CLAMP.maxDelta,
);
}
Expand Down Expand Up @@ -501,7 +501,7 @@ export default defineComponent({
const recyclerRect = this.recycler?.getBoundingClientRect();
const clampedY = Math.max(
(recyclerRect?.top ?? 0) + TOUCH_SELECT_CLAMP.bufferPx,
Math.min((recyclerRect?.bottom ?? 0) - TOUCH_SELECT_CLAMP.bufferPx, touch.clientY)
Math.min((recyclerRect?.bottom ?? 0) - TOUCH_SELECT_CLAMP.bufferPx, touch.clientY),
);
// Which photo is the cursor over, if any
Expand Down
2 changes: 1 addition & 1 deletion src/components/Settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ export default defineComponent({
async chooseFoldersPath() {
const newPath = await utils.chooseNcFolder(
this.t('memories', 'Choose the root for the folders view'),
this.config.folders_path
this.config.folders_path,
);

if (newPath !== this.config.folders_path) {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Sidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export default defineComponent({
},
},
},
globalThis.OCA.Files
globalThis.OCA.Files,
);
}
},
Expand Down
8 changes: 6 additions & 2 deletions src/components/SplitTimeline.vue
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,9 @@ export default defineComponent({
opacity: 0.1;
cursor: col-resize;
margin: 0 0 0 auto;
transition: opacity 0.4s ease-out, background-color 0.4s ease-out;
transition:
opacity 0.4s ease-out,
background-color 0.4s ease-out;
}
> .separator:hover {
Expand Down Expand Up @@ -273,7 +275,9 @@ export default defineComponent({
// Note: you can't use transforms to animate the top
// because it causes the viewer to be rendered incorrectly
transition: top 0.2s ease, height 0.2s ease;
transition:
top 0.2s ease,
height 0.2s ease;
> .timeline-header {
height: 58px;
Expand Down
7 changes: 5 additions & 2 deletions src/components/Timeline.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1069,7 +1069,7 @@ export default defineComponent({
numCols: this.numCols,
allowBreakout: this.allowBreakout(),
seed: dayId,
}
},
);
// Check if some rows were added
Expand Down Expand Up @@ -1359,7 +1359,10 @@ export default defineComponent({
left: 0;
cursor: pointer;
height: 100%;
transition: width 0.2s ease-in-out, height 0.2s ease-in-out, transform 0.2s ease-in-out; // reflow
transition:
width 0.2s ease-in-out,
height 0.2s ease-in-out,
transform 0.2s ease-in-out; // reflow
}
/** Dynamic top matter */
Expand Down
4 changes: 2 additions & 2 deletions src/components/admin/AdminMixin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export default defineComponent({
info: status.substring(10),
},
0,
noescape
noescape,
);
} else if (status.startsWith('test_ok')) {
return this.t(
Expand All @@ -73,7 +73,7 @@ export default defineComponent({
info: status.substring(8),
},
0,
noescape
noescape,
);
} else {
return this.t('memories', '{name} binary status: {status}.', {
Expand Down
6 changes: 3 additions & 3 deletions src/components/admin/sections/Indexing.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@
{{
t(
'memories',
'Looks like it has been more than an hour since the last index job was run. Make sure Nextcloud cron is configured correctly.'
'Looks like it has been more than an hour since the last index job was run. Make sure Nextcloud cron is configured correctly.',
)
}}
</NcNoteCard>
<NcNoteCard type="error" v-if="status.bad_encryption">
{{
t(
'memories',
'Only server-side encryption (OC_DEFAULT_MODULE) is supported, but another encryption module is enabled.'
'Only server-side encryption (OC_DEFAULT_MODULE) is supported, but another encryption module is enabled.',
)
}}
</NcNoteCard>
Expand All @@ -53,7 +53,7 @@
{{
t(
'memories',
'The EXIF indexes are built and checked in a periodic background task. Be careful when selecting anything other than automatic indexing. For example, setting the indexing to only timeline folders may cause delays before media becomes available to users, since the user configures the timeline only after logging in.'
'The EXIF indexes are built and checked in a periodic background task. Be careful when selecting anything other than automatic indexing. For example, setting the indexing to only timeline folders may cause delays before media becomes available to users, since the user configures the timeline only after logging in.',
)
}}
{{ t('memories', 'Folders with a ".nomedia" or a ".nomemories" file are always excluded from indexing.') }}
Expand Down
2 changes: 1 addition & 1 deletion src/components/admin/sections/Performance.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
? t('memories', 'HTTPS is enabled')
: t(
'memories',
'You are accessing this page over an insecure context. Several browser APIs are not available, which will make Memories very slow. Enable HTTPS on your server to improve performance.'
'You are accessing this page over an insecure context. Several browser APIs are not available, which will make Memories very slow. Enable HTTPS on your server to improve performance.',
)
}}
</NcNoteCard>
Expand Down
6 changes: 3 additions & 3 deletions src/components/admin/sections/Places.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@
{{
t(
'memories',
'Memories supports offline reverse geocoding using the OpenStreetMaps data on MySQL and Postgres.'
'Memories supports offline reverse geocoding using the OpenStreetMaps data on MySQL and Postgres.',
)
}}
<br />
{{
t(
'memories',
'You need to download the planet data into your database. This is highly recommended and has low overhead.'
'You need to download the planet data into your database. This is highly recommended and has low overhead.',
)
}}
<br />
Expand Down Expand Up @@ -116,7 +116,7 @@ export default defineComponent({
// construct warning
const warnSetup = this.t(
'memories',
'Looks like the database is already setup. Are you sure you want to redownload planet data?'
'Looks like the database is already setup. Are you sure you want to redownload planet data?',
);
const warnLong = this.t('memories', 'You are about to download the planet database. This may take a while.');
const warnReindex = this.t('memories', 'This may also cause all photos to be re-indexed!');
Expand Down
2 changes: 1 addition & 1 deletion src/components/admin/sections/Video.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
{{
t(
'memories',
'Note that this may be very CPU intensive without hardware acceleration, and transcoding will not be used for external storage.'
'Note that this may be very CPU intensive without hardware acceleration, and transcoding will not be used for external storage.',
)
}}

Expand Down
6 changes: 3 additions & 3 deletions src/components/admin/sections/VideoAccel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
{{
t(
'memories',
'Intel processors supporting QuickSync Video (QSV) as well as some AMD GPUs can be used for transcoding using VA-API acceleration.'
'Intel processors supporting QuickSync Video (QSV) as well as some AMD GPUs can be used for transcoding using VA-API acceleration.',
)
}}
{{ t('memories', 'For more details on driver installation, check the documentation:') }}
Expand Down Expand Up @@ -52,7 +52,7 @@
{{
t(
'memories',
'Depending on the versions of the installed SDK and ffmpeg, you need to specify the scaler to use'
'Depending on the versions of the installed SDK and ffmpeg, you need to specify the scaler to use',
)
}}

Expand Down Expand Up @@ -102,7 +102,7 @@
{{
t(
'memories',
'Due to a bug in certain hardware drivers, videos may appear in incorrect orientations when streaming. This can be resolved in some cases by rotating the video on the accelerator.'
'Due to a bug in certain hardware drivers, videos may appear in incorrect orientations when streaming. This can be resolved in some cases by rotating the video on the accelerator.',
)
}}
<br />
Expand Down
Loading

0 comments on commit 376fa24

Please sign in to comment.