Skip to content

Commit

Permalink
build: Fix Lint problems
Browse files Browse the repository at this point in the history
  • Loading branch information
vorburger committed Nov 1, 2023
1 parent b801bf1 commit 89b84ab
Show file tree
Hide file tree
Showing 29 changed files with 237 additions and 63 deletions.
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ indent_size = unset
[.bazelproject]
indent_size = 2

[humans.txt]
indent_style = tab

[*.md]
indent_size = unset

Expand Down
3 changes: 1 addition & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

version: 2
updates:

- package-ecosystem: "github-actions"
directory: "/"
schedule:
Expand All @@ -12,7 +11,7 @@ updates:
directory: "/"
schedule:
interval: "weekly"

- package-ecosystem: "pip"
directory: "/"
schedule:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
- name: Upload artifact
uses: actions/upload-pages-artifact@a753861a5debcf57bf8b404356158c8e1e33150c # v2.0.0
with:
path: 'site/'
path: site/
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@9dbe3824824f8a1377b8e298bafde1a50ede43e5 # v2.0.4
6 changes: 3 additions & 3 deletions .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# PRs introducing known-vulnerable packages will be blocked from merging.
#
# Source repository: https://github.com/actions/dependency-review-action
name: 'Dependency Review'
name: "Dependency Review"
on: [pull_request]

permissions:
Expand All @@ -21,7 +21,7 @@ jobs:
with:
egress-policy: audit

- name: 'Checkout Repository'
- name: "Checkout Repository"
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
- name: 'Dependency Review'
- name: "Dependency Review"
uses: actions/dependency-review-action@0efb1d1d84fc9633afcdaad14c485cbbc90ef46c # v2.5.1
18 changes: 9 additions & 9 deletions .github/workflows/greetings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ jobs:
issues: write
pull-requests: write
steps:
- name: Harden Runner
uses: step-security/harden-runner@1b05615854632b887b69ae1be8cbefe72d3ae423 # v2.6.0
with:
egress-policy: audit
- name: Harden Runner
uses: step-security/harden-runner@1b05615854632b887b69ae1be8cbefe72d3ae423 # v2.6.0
with:
egress-policy: audit

- uses: actions/first-interaction@15b3c5fd4d93b98e51b27d333f76a50ee6cb0475 # v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
issue-message: "Hi! Thanks for stopping by here, and welcome! Someone will hopefully comment soon."
pr-message: "Hello there! Welcome, and Thank You so much for contributing; Someone will hopefully review this Pull Request (PR) soon."
- uses: actions/first-interaction@15b3c5fd4d93b98e51b27d333f76a50ee6cb0475 # v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
issue-message: "Hi! Thanks for stopping by here, and welcome! Someone will hopefully comment soon."
pr-message: "Hello there! Welcome, and Thank You so much for contributing; Someone will hopefully review this Pull Request (PR) soon."
1 change: 1 addition & 0 deletions .github/workflows/mega-linter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ jobs:
# MegaLinter
- name: MegaLinter

# Keep the version in sync with bin/megalinter.sh
# You can override MegaLinter flavor used to have faster performances
# More info at https://megalinter.io/flavors/
uses: oxsecurity/megalinter@b48455a119cc28045eee8f1e9d0a542a85e71f4f # v7.5.0
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/scorecards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
# To guarantee Maintained check is occasionally updated. See
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained
schedule:
- cron: '20 7 * * 2'
- cron: "20 7 * * 2"
push:
branches: ["main"]

Expand Down
3 changes: 3 additions & 0 deletions .htmlhintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"head-script-disabled": false
}
1 change: 1 addition & 0 deletions .jscpd.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"threshold": 0,
"reporters": ["html", "markdown"],
"ignore": [
"**/megalinter-reports/**",
"**/node_modules/**",
"**/.git/**",
"**/.rbenv/**",
Expand Down
46 changes: 46 additions & 0 deletions .markdownlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# https://github.com/DavidAnson/markdownlint#optionsconfig
# https://github.com/DavidAnson/markdownlint/blob/main/schema/.markdownlint.yaml

# Based on https://github.com/enola-dev/enola/blob/main/.markdownlint.yaml

default: true

MD007:
indent: 6
start_indented: false
# start_indent: 2

MD013:
# Must match .editorconfig [*.md] max_line_length
# This 4096 means "unlimited" (unset) - essentially https://github.com/DavidAnson/markdownlint/issues/298.
# Until https://github.com/DavidAnson/markdownlint/issues/535 is available,
# it's not feasilbe to set this - just too PITA, while writing docs.
#
# One possible avenue to enable fixing automatic reflow formatting could be
# to enable Prettier to format MD (by removing *.md from .prettierignore).
# This ALMOST works, but in Prettier v2.8.4 just has some issues:
# A. Breaks code blocks inside 1. 1. 1. OL; see https://github.com/prettier/prettier/issues/13175
# B. Replaces '*' with '-' for UL; not my preference, but is likely intentional,
# given https://prettier.io/docs/en/option-philosophy.html.
# C. It over-indents '-' causing MD030; see https://github.com/prettier/prettier/issues/5299
# and https://github.com/prettier/prettier/pull/5306 or https://github.com/prettier/prettier/pull/13987 ?
# Another avenue would be to look into a different MD formatter than Prettier,
# perhaps remark directly ... but that seems a bit overkill, for now.
line_length: 4096
code_blocks: true
code_block_line_length: 4096
strict: false
stern: false

# Allow headings ending in '!'
MD026:
punctuation: ",;:。,;:"

# Bare URL are OK
MD034: false

# https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md#md046---code-block-style
# style: "indented" prevents setting code block language
# style: "fenced" enforces ``` and thus prevents indenting, which is nicer to read in raw ASCII where possible
# style: "consistent" prevents mixing indenting (without code block language) and fenced with code block language.
MD046: false
2 changes: 2 additions & 0 deletions .mega-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ DISABLE_LINTERS:
# https://github.com/oxsecurity/megalinter/issues/3017
- REPOSITORY_DEVSKIM

MARKDOWN_MARKDOWNLINT_CONFIG_FILE: .markdownlint.yaml

# Keep this in sync with ignorePaths in .cspell.json
SPELL_LYCHEE_FILTER_REGEX_EXCLUDE: (\.github|\.vscode|.*\.yaml)

Expand Down
18 changes: 9 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
repos:
- repo: https://github.com/gitleaks/gitleaks
rev: v8.16.3
hooks:
- id: gitleaks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/gitleaks/gitleaks
rev: v8.16.3
hooks:
- id: gitleaks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace
2 changes: 2 additions & 0 deletions .secretlintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.venv
megalinter-reports
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# saraswati.learn.study
https://www.learn.study

<https://www.learn.study>
8 changes: 8 additions & 0 deletions bin/clean.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash
set -euxo pipefail

rm -rf BUILT/site/

# docker container prune
# docker image prune
docker system prune
8 changes: 8 additions & 0 deletions bin/lint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash
set -euxo pipefail

# This script is for local use during development, not in CI.
# It is intended to do (roughly) the same thing as the (various) GitHub Actions Workflows.

bin/megalinter.sh
bin/pre-commit.sh
5 changes: 5 additions & 0 deletions bin/megalinter.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
set -euxo pipefail

# Keep the version in sync with .github/workflows/mega-linter.yaml
npx mega-linter-runner --remove-container --image oxsecurity/megalinter-cupcake:v7.5.0
3 changes: 1 addition & 2 deletions docs/directories.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@

* [`docs`](./) internal technical documentation
* [`learn`](../learn/) source of published lessons content (in Markdown, will be processed)
* [`static`](../static/) static web content like images etc. which will be published on the website
* [`site`](../site) website HTML/JS/images; what (the build process puts) here is deployed
* [`static`](../site/) static website content like images etc. which will be published on the website
* [`etc`](../etc) configuration files for various tools
2 changes: 1 addition & 1 deletion learn/computers/setup/editor/codelab.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ TODO ...

## Further Resources

* [Visual Studio Code](../vscode.dev/codelab.md)
* [Visual Studio Code](../vscode.dev/codelab.en.md)
2 changes: 1 addition & 1 deletion learn/computers/setup/keyboard/codelab.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ The _Fn_ key, confusingly, is not a "Function Key", but used e.g. to increase/de

* [ ] I typed 3 words and then pressed Ctrl-Backspace and now only have 2 words

## Find!
## Find

Ctrl-F let's you easily _Find_ something (like _Waldo)._

Expand Down
2 changes: 1 addition & 1 deletion learn/computers/setup/vscode.dev/codelab.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ You can fix this by creating an additional new Keyboard Shorcut to Close Editor;
## Recommended Settings

TODO Put them here, on git, and as copy/paste...

## Remote Development

TODO
Expand Down
6 changes: 3 additions & 3 deletions learn/meta/compare/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Learn.study & ...
# Similar sites

Competition is healthy; let's compare this site to others!

Expand All @@ -10,7 +10,7 @@ Competition is healthy; let's compare this site to others!

The format is different, both e.g. with the focus on videos, and the JS-only playground.

_"E pluribus unum?"_
_E pluribus unum?_

## freeCodeCamp.org

Expand Down Expand Up @@ -63,7 +63,7 @@ Maybe there could be some form of collaboration, or complementary, in the future
- Slides
- Terminal command line etc. type lessons
- Multi-lingual (Modulo is French only, target only local schools in 1 canton of western Switzerland)
- Modulo uses a verbose text heavy writing style, different from [our principles](../../principles/)
- Modulo uses a verbose text heavy writing style, different from [our principles](../about/README.md#principles)
- https://apprendre.modulo-info.ch/projets/ has all solutions? C'est bcp. moins drôle ainsi... 😄

## Other
Expand Down
3 changes: 3 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# PLEASE only use fixed (package)==(version)

pre-commit==3.5.0

# CVE-2022-40897 & GHSA-r9hx-vwmv-q579
setuptools>=65.5.1
20 changes: 20 additions & 0 deletions site/img/creativecommons/by.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 27 additions & 0 deletions site/img/creativecommons/cc.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions site/img/creativecommons/sa.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 89b84ab

Please sign in to comment.