Skip to content

GitHub Action: Super-Linter #53

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
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
39 changes: 32 additions & 7 deletions .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@

## Our Pledge

In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age,
body size, disability, ethnicity, gender identity and expression, level of
experience, nationality, personal appearance, race, religion, or sexual
identity and orientation.

## Our Standards

Expand All @@ -24,23 +29,43 @@ Examples of unacceptable behavior by participants include:

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an
appointed representative at an online or offline event. Representation of a
project may be further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [email protected]. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at [email protected]. The project
team will review and investigate all complaints, and will respond in a way that
it deems appropriate to the circumstances. The project team is obligated to
maintain confidentiality with regard to the reporter of an incident. Further
details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 1.4, available at
[http://contributor-covenant.org/version/1/4][version]

[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
28 changes: 28 additions & 0 deletions .github/workflows/superlinter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Super-Linter

# Run this workflow every time a new commit pushed to your repository
on: push

jobs:
# Set the job key. The key is displayed as the job name
# when a job name is not provided
super-lint:
# Name the Job
name: Lint code base
# Set the type of machine to run on
runs-on: ubuntu-latest

steps:
# Checks out a copy of your repository on the ubuntu-latest machine
- name: Checkout code
uses: actions/checkout@v2

# Runs the Super-Linter action
- name: Run Super-Linter
uses: github/super-linter@v3
env:
DEFAULT_BRANCH: main
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# the standard config conflicts heavily with the upstream config.js
# hence I opted to disable it
VALIDATE_JAVASCRIPT_STANDARD: false
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
FROM node:12-buster

# hadolint ignore=DL3008
RUN set -e; \
apt update; \
apt install -y gettext; \
apt-get update; \
apt-get install -y --no-install-recommends gettext; \
rm -rf /var/lib/apt/lists/*

ARG branch=master
Expand All @@ -16,7 +17,6 @@ RUN cp -R config /opt/default_config
RUN npm install --unsafe-perm --silent

COPY mm-docker-config.js docker-entrypoint.sh ./
RUN chmod +x ./docker-entrypoint.sh

EXPOSE 8080
ENTRYPOINT ["./docker-entrypoint.sh"]
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[![MagicMirror²: The open source modular smart mirror platform. ](https://github.com/MichMich/MagicMirror/raw/master/.github/header.png)](https://github.com/MichMich/MagicMirror)
<!-- markdownlint-disable-next-line MD041 -->
[![MagicMirror²: The open source modular smart mirror platform.](https://github.com/MichMich/MagicMirror/raw/master/.github/header.png)](https://github.com/MichMich/MagicMirror)

**MagicMirror²** is an open source modular smart mirror platform. With a growing list of installable modules, the **MagicMirror²** allows you to convert your hallway or bathroom mirror into your personal assistant.

Expand Down
4 changes: 2 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -e
# https://stackoverflow.com/a/51761312/4934537
latest_release=$(git ls-remote --tags --refs --sort="v:refname" https://github.com/MichMich/MagicMirror.git | tail -n1 | sed 's/.*\///')
if [ "$(docker manifest inspect bastilimbach/docker-magicmirror:"${latest_release}" > /dev/null; echo $?)" != 0 ]; then
docker buildx build --progress plain --platform=linux/amd64,linux/arm64,linux/arm/v7 ${1} --build-arg branch="${latest_release}" -t bastilimbach/docker-magicmirror:"${latest_release}" -t bastilimbach/docker-magicmirror:latest .
docker buildx build --progress plain --platform=linux/amd64,linux/arm64,linux/arm/v7 "${1}" --build-arg branch="${latest_release}" -t bastilimbach/docker-magicmirror:"${latest_release}" -t bastilimbach/docker-magicmirror:latest .
fi

docker buildx build --progress plain --platform=linux/amd64,linux/arm64,linux/arm/v7 ${1} --build-arg branch=develop -t bastilimbach/docker-magicmirror:develop .
docker buildx build --progress plain --platform=linux/amd64,linux/arm64,linux/arm/v7 "${1}" --build-arg branch=develop -t bastilimbach/docker-magicmirror:develop .
Empty file modified docker-entrypoint.sh
100644 → 100755
Empty file.
72 changes: 36 additions & 36 deletions mm-docker-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,78 +9,78 @@
*/

var config = {
address: "0.0.0.0", // Address to listen on, can be:
// - "localhost", "127.0.0.1", "::1" to listen on loopback interface
address: '0.0.0.0', // Address to listen on, can be:
// - 'localhost', '127.0.0.1', '::1' to listen on loopback interface
// - another specific IPv4/6 to listen on a specific interface
// - "0.0.0.0" to listen on any interface
// Default, when address config is left out, is "localhost"
// - '0.0.0.0' to listen on any interface
// Default, when address config is left out, is 'localhost'
port: 8080,
ipWhitelist: [], // Set [] to allow all IP addresses
// or add a specific IPv4 of 192.168.1.5 :
// ["127.0.0.1", "::ffff:127.0.0.1", "::1", "::ffff:192.168.1.5"],
// ['127.0.0.1', '::ffff:127.0.0.1', '::1', '::ffff:192.168.1.5'],
// or IPv4 range of 192.168.3.0 --> 192.168.3.15 use CIDR format :
// ["127.0.0.1", "::ffff:127.0.0.1", "::1", "::ffff:192.168.3.0/28"],
// ['127.0.0.1', '::ffff:127.0.0.1', '::1', '::ffff:192.168.3.0/28'],

language: "en",
language: 'en',
timeFormat: 24,
units: "metric",
units: 'metric',

modules: [
{
module: "alert",
module: 'alert',
},
{
module: "updatenotification",
position: "top_bar"
module: 'updatenotification',
position: 'top_bar'
},
{
module: "clock",
position: "top_left"
module: 'clock',
position: 'top_left'
},
{
module: "calendar",
header: "US Holidays",
position: "top_left",
module: 'calendar',
header: 'US Holidays',
position: 'top_left',
config: {
calendars: [
{
symbol: "calendar-check",
url: "webcal://www.calendarlabs.com/ical-calendar/ics/76/US_Holidays.ics"
symbol: 'calendar-check',
url: 'webcal://www.calendarlabs.com/ical-calendar/ics/76/US_Holidays.ics'
}
]
}
},
{
module: "compliments",
position: "lower_third"
module: 'compliments',
position: 'lower_third'
},
{
module: "currentweather",
position: "top_right",
module: 'currentweather',
position: 'top_right',
config: {
location: "New York",
locationID: "", //ID from http://bulk.openweathermap.org/sample/city.list.json.gz; unzip the gz file and find your city
appid: "YOUR_OPENWEATHER_API_KEY"
location: 'New York',
locationID: '', //ID from http://bulk.openweathermap.org/sample/city.list.json.gz; unzip the gz file and find your city
appid: 'YOUR_OPENWEATHER_API_KEY'
}
},
{
module: "weatherforecast",
position: "top_right",
header: "Weather Forecast",
module: 'weatherforecast',
position: 'top_right',
header: 'Weather Forecast',
config: {
location: "New York",
locationID: "5128581", //ID from http://bulk.openweathermap.org/sample/city.list.json.gz; unzip the gz file and find your city
appid: "YOUR_OPENWEATHER_API_KEY"
location: 'New York',
locationID: '5128581', //ID from http://bulk.openweathermap.org/sample/city.list.json.gz; unzip the gz file and find your city
appid: 'YOUR_OPENWEATHER_API_KEY'
}
},
{
module: "newsfeed",
position: "bottom_bar",
module: 'newsfeed',
position: 'bottom_bar',
config: {
feeds: [
{
title: "New York Times",
url: "http://www.nytimes.com/services/xml/rss/nyt/HomePage.xml"
title: 'New York Times',
url: 'http://www.nytimes.com/services/xml/rss/nyt/HomePage.xml'
}
],
showSourceTitle: true,
Expand All @@ -94,4 +94,4 @@ var config = {
};

/*************** DO NOT EDIT THE LINE BELOW ***************/
if (typeof module !== "undefined") { module.exports = config; }
if (typeof module !== 'undefined') { module.exports = config; }
6 changes: 4 additions & 2 deletions test-build.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/bin/bash

rm -rf ./config
rm -rf ./modules
mkdir config
Expand All @@ -8,7 +10,7 @@ docker build -t mm:latest .
docker run -d \
--publish 80:8080 \
--restart always \
--volume $PWD/config:/opt/magic_mirror/config \
--volume $PWD/modules:/opt/magic_mirror/modules \
--volume "$PWD"/config:/opt/magic_mirror/config \
--volume "$PWD"/modules:/opt/magic_mirror/modules \
--name magic_mirror \
mm:latest