Skip to content

Commit

Permalink
Add prettier
Browse files Browse the repository at this point in the history
Pinned at ^2.8.8 due to version of npm in 22.04 (3.0.0+ doesn't work)
  • Loading branch information
reedy committed Jul 10, 2023
1 parent 8f22188 commit 22c9a6a
Show file tree
Hide file tree
Showing 7 changed files with 87 additions and 1 deletion.
25 changes: 25 additions & 0 deletions .github/workflows/npm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: NPM Actions

#on:
# pull_request:
# branches: [master]
# push:

jobs:
prettier:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3
with:
# Make sure the actual branch is checked out when running on pull requests
ref: ${{ github.head_ref }}
# This is important to fetch the changes to the previous commit
fetch-depth: 0

- name: Prettify code
uses: creyD/[email protected]
with:
dry: True
only_changed: True
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ composer.phar
html/ad*
html/analytics*
import/
node_modules/
php/config.php
php/secrets.php
vendor/*
*.pyc
.idea
.DS_Store
.DS_Store
11 changes: 11 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Ignore artifacts:
build
coverage
# Ignore other files we don't want amending
vendor
composer.json
composer.lock
js/utilities.js
*.html
*.min.css
*.min.js
1 change: 1 addition & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
4 changes: 4 additions & 0 deletions INSTALL
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ sudo certbot --nginx -d [YOUR_DOMAIN]
curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer
sudo -u openflights php /usr/local/bin/composer install

# Set up npm packages if you're going to be developing OpenFlights
sudo apt-get install npm
sudo -u openflights npm install

# Generates locales for language support
cd openflights
find locale -name *utf8 -printf '%f ' | xargs sudo locale-gen
Expand Down
35 changes: 35 additions & 0 deletions package-lock.json

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

9 changes: 9 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"devDependencies": {
"prettier": "^2.8.8"
},
"scripts": {
"lint": "prettier --check .",
"fix": "prettier --write ."
}
}

0 comments on commit 22c9a6a

Please sign in to comment.