From c490eb071100004b645215573290108665694dfb Mon Sep 17 00:00:00 2001 From: "Luis Gustavo S. Barreto" Date: Wed, 24 Apr 2019 15:58:55 -0300 Subject: [PATCH] travis: add linter Signed-off-by: Luis Gustavo S. Barreto --- .travis.yml | 49 +++++++++++++++------------- ui/src/components/PackageDetails.vue | 16 ++++----- ui/src/main.js | 10 +++--- 3 files changed, 39 insertions(+), 36 deletions(-) diff --git a/.travis.yml b/.travis.yml index a13cf06..3fd98c4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,27 +1,30 @@ -language: go - -go_import_path: github.com/UpdateHub/updatehub-ce - -addons: - apt: - sources: - - sourceline: 'ppa:masterminds/glide' - packages: - - libarchive-dev - - glide - matrix: include: - - go: "1.10.x" - install: + - language: go + go: + - "1.11.x" + addons: + apt: + sources: + - sourceline: 'ppa:masterminds/glide' + packages: + - libarchive-dev + - glide + env: + - GO111MODULE=on + go_import_path: github.com/UpdateHub/updatehub-ce + install: true + before_install: - glide install script: go test -v ./... - - go: "1.11.x" - script: go test -v ./... - allow_failures: - - go: master - -env: - - GO111MODULE=on - -install: true + - language: node_js + node_js: + - "12.0" + before_install: + - curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version "1.15.2" + - export PATH="$HOME/.yarn/bin:$PATH" + - cd ui + install: + - yarn install + script: + - yarn run lint --no-fix diff --git a/ui/src/components/PackageDetails.vue b/ui/src/components/PackageDetails.vue index 6ebacec..ad67a7f 100644 --- a/ui/src/components/PackageDetails.vue +++ b/ui/src/components/PackageDetails.vue @@ -125,17 +125,17 @@ export default { return this.$http .get('/api/packages/' + this.$route.params.uid) .then(res => { - return res.data; - }); + return res.data + }) }, - deletePackage() { + deletePackage () { this.$http - .delete("/api/packages/" + this.$route.params.uid + "/delete") - .then(res => { - this.$router.push("/packages"); - }); - }, + .delete('/api/packages/' + this.$route.params.uid + '/delete') + .then(res => { + this.$router.push('/packages') + }) + } }, filters: { diff --git a/ui/src/main.js b/ui/src/main.js index 6d903fe..2d03669 100644 --- a/ui/src/main.js +++ b/ui/src/main.js @@ -13,19 +13,19 @@ import RolloutList from './components/RolloutList' import RolloutNew from './components/RolloutNew' import RolloutDetails from './components/RolloutDetails' -function errorResponseHandler(error) { +function errorResponseHandler (error) { if (error.response.status === 401) { - app.currentUser = null; - router.push("/login?redirect=" + "/") + app.currentUser = null + router.push('/login?redirect=' + '/') } } Axios.interceptors.response.use( response => response, errorResponseHandler -); +) -Vue.config.productionTip = false; +Vue.config.productionTip = false Vue.prototype.$http = Axios