Skip to content

Commit

Permalink
feat: add GitHub actions for spell checking, trailing whitespace and …
Browse files Browse the repository at this point in the history
…YAML

Lint Markdown and YAML. Fix spelling.
  • Loading branch information
jbampton committed Feb 14, 2021
1 parent 1f5893f commit fad1e82
Show file tree
Hide file tree
Showing 39 changed files with 153 additions and 105 deletions.
2 changes: 1 addition & 1 deletion .github/invite-contributors.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# team name
team: Maintainers
team: Maintainers
55 changes: 46 additions & 9 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,51 @@ name: Lint Markdown
on: [push, pull_request]

jobs:
build:
markdown:
name: Markdown Lint
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: '14'
- name: Install modules
run: yarn
- run: yarn markdown:lint
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: '14'
- name: Install modules
run: yarn
- run: yarn markdown:lint
misspell:
name: Check Spelling
runs-on: ubuntu-latest
steps:
- name: Check Out
uses: actions/checkout@v2
- name: Install
run: |
wget -O - -q https://git.io/misspell | sh -s -- -b .
- name: Misspell
run: |
git ls-files --empty-directory | xargs ./misspell -error
trailing-whitespace:
name: Trailing whitespace
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Check for trailing whitespace
run: "! git grep -EIn $'[ \t]+$'"
yamllint:
name: YAML
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.x' # Version range or exact version of a Python version to use, using SemVer's version range syntax
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install yamllint
- name: YAML Lint
run: |
# return non-zero exit code on warnings
yamllint --strict .
9 changes: 9 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---

extends: default

rules:
colons: disable
document-start: disable
line-length: disable
truthy: false
4 changes: 2 additions & 2 deletions contributors/contributors.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@
bio: "Web Developer"
avatar: ./images/rcheuk.png
twitter: "@rachel_cheuk"

- id: remi2j
name: Remi de Juvigny
bio: "Software Engineer"
Expand Down Expand Up @@ -281,4 +281,4 @@
name: Danilo Raisi
bio: "Software Engineer"
avatar: ./images/daniloraisi.jpeg
twitter: "@daniloraisi"
twitter: "@daniloraisi"
12 changes: 6 additions & 6 deletions docs/assets-css.md
Original file line number Diff line number Diff line change
Expand Up @@ -367,14 +367,14 @@ export default function (Vue, { head }) {
rel: 'stylesheet',
href: 'https://cdn.jsdelivr.net/npm/@mdi/font@latest/css/materialdesignicons.min.css',
})

head.link.push({
rel: 'stylesheet',
href: 'https://fonts.googleapis.com/css2?family=Roboto:wght@100;300;400;500;700;900',
});

Vue.use(Vuetify)

// Set default layout as a global component
Vue.component('Layout', DefaultLayout)
}
Expand All @@ -391,17 +391,17 @@ export default function (Vue, { appOptions, head }) {
rel: 'stylesheet',
href: 'https://cdn.jsdelivr.net/npm/@mdi/font@latest/css/materialdesignicons.min.css',
})

head.link.push({
rel: 'stylesheet',
href: 'https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900',
});

const opts = { ... } //opts includes, vuetify themes, icons, etc.
Vue.use(Vuetify)

appOptions.vuetify = new Vuetify(opts);

// Set default layout as a global component
Vue.component('Layout', DefaultLayout)
}
Expand Down
8 changes: 4 additions & 4 deletions docs/assets-scripts.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ import moment from 'moment';
export default function (Vue) {
// Set default layout as a global component
Vue.component('Layout', DefaultLayout)

//Use Moment.Js library inside our project
Object.defineProperty(Vue.prototype, '$moment', {
value: moment
Expand Down Expand Up @@ -203,17 +203,17 @@ In the same way, you can use any external library that causes issues in server s

<script>
// import $ from 'jquery'; //import it inside main.js
export default {
name: 'Index',
mounted() {
//require our external library and load it in window
window.owl = require('owl-carousel')
window.$ = require('jquery')
// This works now
$('.some-carousel').owlCarousel()
}
}
</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/body-html-attributes.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Global body or head attributes are added in `src/main.js`.
export default function (Vue, { head }) {
// Add attributes to HTML tag
head.htmlAttrs = { lang: 'en' }

// Add attributes to BODY tag
head.bodyAttrs = { class: 'custom-body-class' }
}
Expand Down
4 changes: 2 additions & 2 deletions docs/deploy-to-az-static-web-app.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Azure Static Web Apps publishes a website to a prodution environment by building

### Create a static web app

After you created your GitHub repository and commited your code, you can create a static web app from the Azure portal.
After you created your GitHub repository and committed your code, you can create a static web app from the Azure portal.

1. Navigate to the [Azure Portal](https://portal.azure.com)
2. Select **Create a Resource**
Expand Down Expand Up @@ -57,7 +57,7 @@ After you sign in with GitHub, enter the repository information.

## View the website

When you create an Azure Static Web App, Azure resources are provisined to make up your app. Also a GitHub Action workflow is created and commited to your repository. This workflow builds and publishes your application.
When you create an Azure Static Web App, Azure resources are provisioned to make up your app. Also a GitHub Action workflow is created and committed to your repository. This workflow builds and publishes your application.

Before you can navigate to your new static site, the deployment build must first finish running.

Expand Down
2 changes: 1 addition & 1 deletion docs/deploy-to-netlify.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Alternatively, you can deploy using a `netlify.toml` file. Create a file in the
command = "gridsome build"
```

More infomation on `netlify.toml` files can be found in the [Netlify docs](https://www.netlify.com/docs/netlify-toml-reference/).
More information on `netlify.toml` files can be found in the [Netlify docs](https://www.netlify.com/docs/netlify-toml-reference/).

**Note:**

Expand Down
5 changes: 3 additions & 2 deletions docs/dev-tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,13 @@ module.exports = {

## Vetur

[Vetur](https://marketplace.visualstudio.com/items?itemName=octref.vetur) is Vue tooling for VS Code.
[Vetur](https://marketplace.visualstudio.com/items?itemName=octref.vetur) is Vue tooling for VS Code.

Vetur works perfect with Gridsome.

### GraphQL syntax for `<page-query>` and `<static-query>`

Detail is [here](https://github.com/vuejs/vetur/issues/975#issuecomment-461197031)
Detail is [here](https://github.com/vuejs/vetur/issues/975#issuecomment-461197031)

1. Install [GraphQL](https://marketplace.visualstudio.com/items?itemName=kumar-harsh.graphql-for-vscode)
2. Add this item in `settings.json`
Expand Down
7 changes: 4 additions & 3 deletions docs/head.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default function (Vue, { head }) {
rel: 'stylesheet',
href: 'https://some-server.com/external-styleheet.css'
})

// Add an external JavaScript before the closing </body> tag
head.script.push({
src: 'https://some-server.com/external-script.js',
Expand Down Expand Up @@ -87,8 +87,9 @@ export default {

## How to overwrite from child component

If you need to overwrite meta tags, add `key` property.
Gridsome is passing `tagIdKeyName: 'key'` to vue-meta as default option.
If you need to overwrite meta tags, add `key` property.

Gridsome is passing `tagIdKeyName: 'key'` to vue-meta as default option.

```js
// parent component
Expand Down
2 changes: 1 addition & 1 deletion docs/querying-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ export default {
functional: true,
render(createElement, context) {
const { content } = context.data.$static.post
return createElement('div', {
domProps: {
innerHTML: content
Expand Down
2 changes: 1 addition & 1 deletion examples/create-pages-api.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Programmatically generate pages
title: Programmatically generate pages
filepath: gridsome.server.js
filetype: js
order: 10
Expand Down
2 changes: 1 addition & 1 deletion examples/dynamic-routing.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ order: 4
```html
<template>
<div v-if="user">
<!-- Add a [param].vue file in src/pages
<!-- Add a [param].vue file in src/pages
folder to create a dynamic route -->
<h1>{{ user.name }}</h1>
</div>
Expand Down
2 changes: 1 addition & 1 deletion examples/progressive-images.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ order: 10

<g-image src="~/assets/images.jpg" width="500" />

<!-- This will render a small
<!-- This will render a small
ultra-compressed, blurred inline base64 image
before it's lazy loaded into view with
Intersection Observer -->
Expand Down
2 changes: 1 addition & 1 deletion examples/taxonomy-pages.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ order: 5
```html
<template>
<Layout>
<!-- Creates a template for a "Tag" that
<!-- Creates a template for a "Tag" that
lists all post with same tag -->
<h1>{{ $page.tag.title }}</h1>
<ul>
Expand Down
6 changes: 3 additions & 3 deletions platforms/logos/elastic-path.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/assets/style/bullet-list.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
vertical-align: middle;
margin-top: -2px;
color: var(--primary-color);
}
}
}
}
2 changes: 1 addition & 1 deletion src/assets/style/button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
&.primary {
color: #FFF;
background-color: var(--primary-color-dark);

&:after {
border-color: rgba(0,0,0,.1);
}
Expand Down
6 changes: 3 additions & 3 deletions src/assets/style/docs.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
}
}


h1, h2, h3 {
padding-top: 6rem;
margin-top: -5rem;
Expand Down Expand Up @@ -66,7 +66,7 @@
transition: border-color .3s;
}
}

h3 { opacity: .9 }

h4, h5, h6 { opacity: .8 }
Expand All @@ -92,7 +92,7 @@
display: flex;
align-items: center;
padding-top: 1rem;

&:not(:hover) {
color: var(--primary-color-dark);
}
Expand Down
2 changes: 1 addition & 1 deletion src/assets/style/grid.scss
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ ul.flex {

&--collapse {
grid-gap: 0;

> div:first-child {
border-right:0;
border-top-right-radius: 0;
Expand Down
4 changes: 2 additions & 2 deletions src/assets/style/links.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ a {
color: var(--body-color);
text-decoration-color: var(--body-color);
}

svg + & {
margin-left: .5rem;
}
Expand All @@ -22,4 +22,4 @@ a {

a:hover:not(.active) {
opacity: 1;
}
}
4 changes: 2 additions & 2 deletions src/assets/style/sidebar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
&.active--exact {
color: var(--primary-color-dark);
}

&:hover {
color: var(--primary-color);
}
Expand Down Expand Up @@ -127,7 +127,7 @@
margin:0;
order: 2;
padding-bottom: 150px;

} + .section {
margin-left: 0;
width: 100%;
Expand Down
2 changes: 1 addition & 1 deletion src/components/Card.vue
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export default {
overflow: hidden;
border-bottom: 1px solid var(--border-color);
transition: border-color .3s;
img {
margin: 0;
width: 100%;
Expand Down
Loading

0 comments on commit fad1e82

Please sign in to comment.