Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
node_modules/
vendor/
*.log
build/
js/
.rvm
report
clover.xml
composer.lock

# just sane ignores
.*.sw[po]
Expand Down
1 change: 1 addition & 0 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ build:
tests:
override:
- php-scrutinizer-run
- phpcs-run --standard=phpcs.xml appinfo/ lib/
- eslint-run --ext .js,.vue src

tools:
Expand Down
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ script:
# - phpunit -c phpunit.integration.xml

# build js
- make npm-init
- make init
- make lint
- make stylelint
- make build-js-production

64 changes: 40 additions & 24 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,32 +9,32 @@ appstore_dir=$(build_dir)/appstore
package_name=$(app_name)
cert_dir=$(HOME)/.nextcloud/certificates

appstore: clean
appstore: clean lint build-js-production
mkdir -p $(sign_dir)
rsync -a \
--exclude=.git \
--exclude=.babelrc.js \
--exclude=build \
--exclude=.gitignore \
--exclude=.travis.yml \
--exclude=.scrutinizer.yml \
--exclude=CONTRIBUTING.md \
--exclude=composer.json \
--exclude=composer.lock \
--exclude=composer.phar \
--exclude=.tx \
--exclude=CONTRIBUTING.md \
--exclude=.editorconfig \
--exclude=.eslintrc.js \
--exclude=.git \
--exclude=.github \
--exclude=.gitignore \
--exclude=l10n/no-php \
--exclude=Makefile \
--exclude=nbproject \
--exclude=screenshots \
--exclude=package*.json \
--exclude=phpcs.xml \
--exclude=phpunit*xml \
--exclude=.scrutinizer.yml \
--exclude=src \
--exclude=.stylelintrc.js \
--exclude=tests \
--exclude=vendor/bin \
--exclude=js/node_modules \
--exclude=js/tests \
--exclude=js/karma.conf.js \
--exclude=js/gulpfile.js \
--exclude=js/bower.json \
--exclude=js/package.json \
--exclude=.travis.yml \
--exclude=.tx \
--exclude=vendor \
$(project_dir) $(sign_dir)
@echo "Signing…"
php ../server/occ integrity:sign-app \
Expand All @@ -51,7 +51,12 @@ appstore: clean
all: dev-setup lint build-js-production test

# Dev env management
dev-setup: clean clean-dev npm-init
dev-setup: clean clean-dev init

init: composer-init npm-init

composer-init:
composer install

npm-init:
npm install
Expand Down Expand Up @@ -84,17 +89,27 @@ test-coverage:
npm run test:coverage

# Linting
lint:
npm run lint
lint: lint-php lint-js lint-css

lint-fix:
npm run lint:fix
lint-php:
vendor/bin/phpcs --standard=phpcs.xml --runtime-set ignore_warnings_on_exit 1 appinfo/ lib/

# Style linting
stylelint:
lint-js:
npm run lint

lint-css:
npm run stylelint

stylelint-fix:
# Fix lint
lint-fix: lint-php-fix lint-js-fix lint-css-fix

lint-php-fix:
vendor/bin/phpcbf --standard=phpcs.xml appinfo/ lib/

lint-js-fix:
npm run lint:fix

lint-css-fix:
npm run stylelint:fix

# Cleaning
Expand All @@ -104,4 +119,5 @@ clean:

clean-dev:
rm -rf node_modules
rm -rf vendor

19 changes: 9 additions & 10 deletions appinfo/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,13 @@
$container = $app->getContainer();

$container->query('OCP\INavigationManager')->add(function () use ($container) {
$urlGenerator = $container->query('OCP\IURLGenerator');
$l10n = $container->query('OCP\IL10N');
return [
'id' => 'notes',
'order' => 10,
'href' => $urlGenerator->linkToRoute('notes.page.index'),
'icon' => $urlGenerator->imagePath('notes', 'notes.svg'),
'name' => $l10n->t('Notes')
];
$urlGenerator = $container->query('OCP\IURLGenerator');
$l10n = $container->query('OCP\IL10N');
return [
'id' => 'notes',
'order' => 10,
'href' => $urlGenerator->linkToRoute('notes.page.index'),
'icon' => $urlGenerator->imagePath('notes', 'notes.svg'),
'name' => $l10n->t('Notes')
];
});

3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"require-dev": {
"christophwurst/nextcloud": "^15.0"
"christophwurst/nextcloud": "^15.0",
"squizlabs/php_codesniffer": "3.*"
}
}
31 changes: 11 additions & 20 deletions lib/Controller/Errors.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
<?php
/**
* Nextcloud - Notes
*
* This file is licensed under the Affero General Public License version 3 or
* later. See the COPYING file.
*
* @author Bernhard Posselt <dev@bernhard-posselt.com>
* @copyright Bernhard Posselt 2012, 2014
*/

namespace OCA\Notes\Controller;

Expand All @@ -22,15 +13,15 @@
* @package OCA\Notes\Controller
*/
trait Errors {
/**
* @param $callback
* @return DataResponse
*/
protected function respond ($callback) {
try {
return new DataResponse($callback());
} catch(NoteDoesNotExistException $ex) {
return new DataResponse([], Http::STATUS_NOT_FOUND);
}
}
/**
* @param $callback
* @return DataResponse
*/
protected function respond($callback) {
try {
return new DataResponse($callback());
} catch (NoteDoesNotExistException $ex) {
return new DataResponse([], Http::STATUS_NOT_FOUND);
}
}
}
Loading