Skip to content

Commit

Permalink
Js scss reformttings (#167)
Browse files Browse the repository at this point in the history
* Reformatted .inc and our packackage.json to have consistent 2 spaces of padding
* changed all var's to const/let
* removed extended data as unused
* removed leading zeros from scss files.
This is more consistent with the style used across most of the project
* removed object shorthands.
This way is more consistent across the existing codebase
* switched from the rgba to the rgb css widget.
Reasoning is, that it seems a bit more readable and browser support is there: https://caniuse.com/mdn-css_types_color_rgb_alpha_parameter
* removed useless extra clutter in the scss files, which stylint wants
* whitespace changes for js files
* removed .scss from scss imports for consistency
* Changed aditional var to const/let
* Removed curly string and console warnings, as they are more noise than signal
* fixed non scss compliant use of rgb
added stylelint-scss to the plugins
* changes to make scss files compliant:
- modules should be used instead of raw global functions
- `border: 0;` is more constinent to `border: none;`
- Only let stylint run over css files (it has some isues with the vue syntax)
* removed the unused function GETRequest()
* history=>window.history
* Used Object.values instead of for..in
Reason:
for..in loops iterate over the entire prototype chain, which is virtually never what you want. Use Object.{keys,values,entries}, and iterate over the resulting array
* added globals for the common js globals
* allowed dangling underscored and made more things contain underscores
* fixed how for loops are used:
.forEach is superiour to for..of due to Polyfills and other issues
* moved addEventListener to document.addEventListener
* prefered explicit function-arg defaults, instead of exchanging after the fact
* moved regenerator-runtime to npm
* removed CustomEvent polyfill (for IE)
* mostly unified the functions (named,unnamed, arrow) used by JS
gulpfile.js is the odd one out.
* migrated from node-sass to dartSass.
Reasoning: sass/node-sass#2886
* reordered the dependencies in the package.json:
- only things that modern browsers use are getting delivered are listed as dependencys.
- polyfills/build tooling is listed as below the other Dependencies, because while included in prod, they are only delivered to a minority of users
* replaces navigatum.cloneState with the buildin structuredClone
see https://caniuse.com/mdn-api_structuredclone with a polyfill for samsung internet
* added conditional feedback.js minification
* changed the method how we rename files in the gulpfile
* added better maintianed version of spectre.css

Co-authored-by: octycs <[email protected]>
Co-authored-by: octycs <[email protected]>
  • Loading branch information
3 people authored Jul 31, 2022
1 parent 1f18d27 commit 6e16862
Show file tree
Hide file tree
Showing 38 changed files with 3,740 additions and 3,737 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ jobs:

env:
SCHEMATHESIS_BASE: st run $API_SCHEMA --checks=all --base-url="http://localhost:8080"
SCHEMATHESIS_REPORT: 'true'
SCHEMATHESIS_REPORT: "true"
SCHEMATHESIS_TOKEN: ${{ secrets.SCHEMATHESIS_TOKEN }}
SCHEMATHESIS_API_NAME: navigatum
continue-on-error: true
Expand Down Expand Up @@ -105,4 +105,4 @@ jobs:
- api-tests
steps:
- run: curl -sSL -o /usr/local/bin/argocd https://github.com/argoproj/argo-cd/releases/latest/download/argocd-linux-amd64 && chmod +x /usr/local/bin/argocd
- run: argocd app actions run navigatum restart --kind Deployment --resource-name navigatum-server --auth-token ${{ secrets.ARGOCD_TOKEN }} --server ${{ secrets.ARGOCD_SERVER }}
- run: argocd app actions run navigatum restart --kind Deployment --resource-name navigatum-server --auth-token ${{ secrets.ARGOCD_TOKEN }} --server ${{ secrets.ARGOCD_SERVER }}
105 changes: 105 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: check-ast
- id: check-toml
- id: check-yaml
args:
- --allow-multiple-documents
exclude: "data/data_format_geo-entry.yaml"
- id: check-json
- id: check-executables-have-shebangs
- id: check-shebang-scripts-are-executable
- id: check-merge-conflict
- id: check-case-conflict
- id: check-docstring-first
- id: debug-statements
- id: end-of-file-fixer
- id: mixed-line-ending
- id: requirements-txt-fixer
# only server
- repo: local
hooks:
- id: cargo-fmt
name: cargo fmt
entry: bash -c 'cd server && cargo fmt'
language: system
pass_filenames: false
- id: cargo-check
name: cargo check
entry: bash -c 'cd server && cargo check'
language: system
pass_filenames: false
- id: cargo-clippy
name: cargo clippy
entry: bash -c 'cd server && cargo clippy'
language: system
pass_filenames: false
# only webclient
- repo: https://github.com/paulhfischer/prettier-config
rev: v1.4.0
hooks:
- id: lint
- repo: https://github.com/paulhfischer/stylelint-config
rev: v1.3.0
hooks:
- id: lint
files: \.(css|scss|sass)$
- repo: https://github.com/paulhfischer/eslint-config-javascript
rev: v1.8.4
hooks:
- id: lint
# only data
- repo: https://github.com/PyCQA/isort
rev: 5.10.1
hooks:
- id: isort
- repo: https://github.com/asottile/add-trailing-comma
rev: v2.2.3
hooks:
- id: add-trailing-comma
- repo: https://github.com/psf/black
rev: 22.3.0
hooks:
- id: black
language_version: python3
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.9.0
hooks:
- id: python-check-blanket-noqa
- id: python-use-type-annotations
- repo: local
hooks:
- id: mypy
name: mypy
entry: mypy
language: system
types: [python]
- repo: https://gitlab.com/PyCQA/flake8
rev: 3.9.2
hooks:
- id: flake8
additional_dependencies:
- flake8-broken-line
- flake8-commas
- flake8-bugbear
- flake8-comprehensions
- flake8-mutable
- flake8-return
- flake8-typing-imports
- flake8-simplify
- flake8-print
- flake8-use-fstring
- repo: https://github.com/PyCQA/bandit
rev: 1.7.4
hooks:
- id: bandit
- repo: local
hooks:
- id: pylint
name: pylint
entry: pylint
language: system
types: [python]
exclude: migrations
1 change: 0 additions & 1 deletion data/sources/02_rooms-extended.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,3 @@

# === MI ===
"5608.EG.150": {coords: {lat: 48.262263704348356, lon: 11.66808379149225}}

1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ jobs=0
[tool.pylint."MESSAGES CONTROL"]
disable=[
"logging-fstring-interpolation", # not using fstrings in logging calls looks awfull, and would only be a small permance optimization
"print-statement",
"missing-module-docstring", # too much work
"missing-class-docstring", # too much work
"line-too-long", # we have another hook for this
Expand Down
26 changes: 13 additions & 13 deletions webclient/config.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
export const configRelease = {
/* --- Site configuration --- */
// Prefix for resource loading, e.g. "/app/" if the page is
// running at "example.com/app/".
// Setting it to "" makes paths relative. This only works for
// hash-based navigation in development builds.
app_prefix: "/",
// Prefix for 'cdn' content, e.g. images.
cdn_prefix: "https://nav.tum.sexy/cdn/",
// Prefix for API requests
api_prefix: "https://nav.tum.sexy/api/",
/* --- Site configuration --- */
// Prefix for resource loading, e.g. "/app/" if the page is
// running at "example.com/app/".
// Setting it to "" makes paths relative. This only works for
// hash-based navigation in development builds.
app_prefix: "/",
// Prefix for 'cdn' content, e.g. images.
cdn_prefix: "https://nav.tum.sexy/cdn/",
// Prefix for API requests
api_prefix: "https://nav.tum.sexy/api/",
};

export const configLocal = {
app_prefix: "",
cdn_prefix: "/cdn/",
api_prefix: "http://localhost:8080/api/",
app_prefix: "",
cdn_prefix: "/cdn/",
api_prefix: "http://localhost:8080/api/",
};
Loading

0 comments on commit 6e16862

Please sign in to comment.