Skip to content
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

Adicionado o arquivo .prettierrc com a configuração do Prettier #292

Merged
merged 27 commits into from
Feb 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
eb25fdb
Added .prettierrc
george-gca Jan 16, 2025
c43e875
Changed prettier action
george-gca Jan 16, 2025
71eb143
Changed checkout step
george-gca Jan 16, 2025
fae8295
Reverted prettier action
george-gca Jan 16, 2025
b4f2acf
Updated prettierrc
george-gca Jan 16, 2025
3dadf44
Updated prettierrc
george-gca Jan 16, 2025
a82707f
Testing new prettier workflow
george-gca Jan 16, 2025
ba452a2
Avoid error when pattern is unmatched
george-gca Jan 16, 2025
f53a7e4
Removed if condition
george-gca Jan 16, 2025
1fe49dc
Re-added github ref
george-gca Jan 16, 2025
4c78e29
Added write permission
george-gca Jan 16, 2025
7cdd161
Removed github ref
george-gca Jan 16, 2025
618fa9f
Re-enabled ref
george-gca Jan 16, 2025
7ef2141
Changed to only check with prettier instead of applying changes
george-gca Jan 16, 2025
d122fa6
Formatted repository files
george-gca Jan 16, 2025
da6a398
Comment pre-commit-hooks
george-gca Feb 1, 2025
6fabfd6
Formated data files
george-gca Feb 1, 2025
119082d
Uncommented pre-commit-hooks
george-gca Feb 1, 2025
19ca015
Fixed prettier for new code
george-gca Feb 1, 2025
bd2a9d4
Changed sort-data action
george-gca Feb 1, 2025
dfe972e
Avoid format_data.py when file is strings.yml
george-gca Feb 1, 2025
483f89c
Fixed prettier complaints
george-gca Feb 4, 2025
a5e7a17
Renamed scripts.js.liquid, moved non-localized scripts to cards.js
george-gca Feb 4, 2025
76b8ef5
Leave only localized code on localized_scripts.js
george-gca Feb 4, 2025
84f988e
Updated CONTRIBUTING.md
george-gca Feb 4, 2025
5b53388
Undo format on localized_scripts.js.liquid
george-gca Feb 4, 2025
5a62992
Added localized_scripts.js.liquid to prettierignore
george-gca Feb 4, 2025
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
6 changes: 1 addition & 5 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,7 @@

"customizations": {
"vscode": {
"extensions": [
"esbenp.prettier-vscode",
"sissel.shopify-liquid",
"yzhang.markdown-all-in-one"
],
"extensions": ["esbenp.prettier-vscode", "sissel.shopify-liquid", "yzhang.markdown-all-in-one"],
"settings": {
// use prettier code formatter as default formatter
"editor.defaultFormatter": "esbenp.prettier-vscode",
Expand Down
42 changes: 36 additions & 6 deletions .github/workflows/prettier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,44 @@ jobs:
format:
runs-on: ubuntu-latest

permissions:
contents: write

steps:
- name: Checkout code
uses: actions/[email protected]
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4

- name: Install Prettier
run: npm install --save-dev --save-exact prettier @shopify/prettier-plugin-liquid

- name: Prettier check
id: prettier
run: npx prettier . --check

- name: Create diff
# https://docs.github.com/en/actions/learn-github-actions/expressions#failure
if: ${{ failure() }}
run: |
npx prettier . --write
git diff -- . ':(exclude)package-lock.json' ':(exclude)package.json' > diff.txt
npm install -g diff2html-cli
diff2html -i file -s side -F diff.html -- diff.txt

- name: Upload html diff
id: artifact-upload
if: ${{ failure() && steps.prettier.conclusion == 'failure' }}
uses: actions/upload-artifact@v4
with:
ref: ${{ github.head_ref }}
name: HTML Diff
path: diff.html
retention-days: 7

- name: Run Prettier
uses: AbdulRehman-1/pr-prettier@initial
- name: Dispatch information to repository
if: ${{ failure() && steps.prettier.conclusion == 'failure' && github.event_name == 'pull_request' }}
uses: peter-evans/repository-dispatch@v2
with:
only_changed: true
prettier_options: --write **/*.{css,html,js,json,liquid,md,scss,yaml,yml}
event-type: prettier-failed-on-pr
client-payload: '{"pr_number": "${{ github.event.number }}", "artifact_url": "${{ steps.artifact-upload.outputs.artifact-url }}", "run_id": "${{ github.run_id }}"}'
11 changes: 7 additions & 4 deletions .github/workflows/sort-data.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ jobs:
contents: write

steps:
- uses: actions/[email protected]
with:
ref: ${{ github.head_ref }}
- name: Checkout code
uses: actions/checkout@v4

- name: Get changed data files
- name: Check if changed data files
id: changed-data
uses: tj-actions/[email protected]
with:
files: _data/**.yml
files_ignore: _data/**/strings.yml

- name: Setup Python
if: steps.changed-data.outputs.any_changed == 'true'
Expand All @@ -43,6 +43,9 @@ jobs:
ALL_CHANGED_FILES: ${{ steps.changed-data.outputs.all_changed_files }}
run: |
for file in $ALL_CHANGED_FILES; do
if [[ $(basename $file) == "strings.yml" ]]; then
continue
fi
echo "Formatting $file"
python3 format_data.py -f $file
done
Expand Down
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
**/*.min.js
.jekyll-cache/
.mypy_cache/
_scripts/localized_scripts.js.liquid
3 changes: 3 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
plugins: ["@shopify/prettier-plugin-liquid"]
printWidth: 150
trailingComma: "es5"
19 changes: 8 additions & 11 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,7 @@ diciotech
│   ├── img
│   │   └── ...
│   └── js
│   ├── cookies.js
│   ├── levenshtein.js
│   ├── pwa.js
│   └── theme.js
│   └── ...
├── _config.yml (arquivo de configuração do Jekyll)
├── _data (aqui devem ser adicionados os termos e definições)
│   ├── en-us
Expand Down Expand Up @@ -85,7 +82,7 @@ diciotech
│   ├── light_theme.scss
│   └── variables.scss
├── _scripts (aqui devem ficar códigos js que dependem de valores do Jekyll)
│   └── scripts.js.liquid
│   └── localized_scripts.js.liquid
└── _site (onde o Jekyll gera o site final, não deve ser versionado)
└── ...
```
Expand All @@ -96,8 +93,8 @@ Dentre os arquivos e pastas, os mais importantes são:
- `_data/LANG/strings.yml`: onde ficam as traduções dos termos na página que não são termos do dicionário;
- `_layouts/base.liquid`: layout base da página, basicamente um html com variáveis em liquid definidas em `_data/LANG/strings.yml`;
- `_sass/`: onde ficam os arquivos de estilo do site. Aqui é onde você deve fazer mudanças de css;
- `_scripts/`: onde ficam códigos js que dependem de valores do Jekyll. Você pode adicionar códigos novos no arquivo `scripts.js.liquid`, ou criar novos arquivos. Lembre-se de incluir os arquivos novos no layout base;
- `assets/`: onde ficam os arquivos de css, js e imagens que são copiados tal qual para o site final.
- `_scripts/`: onde ficam códigos js que dependem de valores do Jekyll. Você pode adicionar códigos novos no arquivo `localized_scripts.js.liquid`, ou criar novos arquivos. Lembre-se de incluir os arquivos novos no layout base;
- `assets/`: onde ficam os arquivos que são copiados tal qual para o site final.

## Como funciona o build do site

Expand All @@ -115,8 +112,7 @@ permalink: / # link no qual a página vai ser acessada
O layout base é um arquivo que contém o html básico de todas as páginas, e é onde são incluídos os arquivos de css e js necessários para o site. A extensão `.liquid` é uma extensão padrão usada pelo Jekyll. No layout básico é possível encontrar algumas expressões como:

```liquid
<meta name="description" content="{{ page.site_description }}">
{% include script.liquid.js %}
<meta name="description" content="{{ page.site_description }}"> {% include script.liquid.js %}
```

Valores definidos no front matter das páginas são acessados via `{{ page.XXX }}`, como `{{ page.site_description }}`, enquanto valores definidos no arquivo `_config.yml` são acessados como `{{ site.XXX }}`, por exemplo `{{ site.baseurl }}`. Expressões delimitadas por `{% %}` como `{% include script.liquid.js %}` são expressões que são processadas durante o build pelo Jekyll. Para mais informações sobre o Jeyll, veja a [documentação oficial](https://jekyllrb.com/docs/step-by-step/01-setup/) (em inglês).
Expand All @@ -135,18 +131,19 @@ _site/
│   ├── img
│   │   └── ...
│   └── js
│   ├── cards.js
│   ├── cookies.js
│   ├── levenshtein.js
│   ├── localized_scripts.js
│   ├── pwa.js
│   ├── scripts.js
│   └── theme.js
├── diciotech.webmanifest
├── en-us
│   ├── assets
│   │   ├── data
│   │   | └── cards.json
| | └── js
| | └── scripts.js
| | └── localized_scripts.js
│   ├── diciotech.webmanifest
│   └── index.html
└── index.html
Expand Down
49 changes: 24 additions & 25 deletions _data/en-us/a.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
- title: Abstraction
tags:
- Concept
- Concept
description: An abstraction is a simplification of specific point(s) of some system
or behavior that we are trying to understand. In programming, we use abstractions
all the time. This means that we don't need to understand all the deep technical
details to write code - like the inner workings of a computer. Instead, we can
use simpler ideas to create our programs.
- title: Adversarial Training
tags:
- Artificial intelligence
- Concept
- Artificial intelligence
- Concept
description: It is a type of machine learning training that uses an adversarial
model to train a model. In it, two machine learning models are trained in an adversarial
manner, where one model is responsible for generating fake data and another model
is responsible for identifying fake data. Adversarial training is used to generate
realistic fake data, which can be used to augment a training dataset.
- title: AIoT
tags:
- Concept
- Concept
description: AIoT (Artificial Intelligence of Things) is the combination of Artificial
Intelligence (AI) with the Internet of Things (IoT). Its main goal is to automate
and accelerate the processing of data generated by IoT devices, with minimal human
Expand All @@ -26,39 +26,39 @@
would be necessary to rely on human intervention to make it useful.
- title: Algorithm
tags:
- Concept
- Concept
description: An algorithm is like a cake recipe for a computer. It is a set of organized
steps that help solve a problem, such as doing math or analyzing information.
- title: Angular.js
tags:
- Framework
- Front-end
- Framework
- Front-end
description: Angular.js is a tool developed by Google that facilitates the creation
of websites or applications that work as a single page (SPAs), that is, without
reloading the entire page with each interaction. It organizes the code efficiently
using "modules" and "dependency injection", which helps keep everything easier
to manage. Large companies like Google and Microsoft use this technology.
- title: API
tags:
- Back-end
- Concept
description: 'API is an acronym that means Application Programming Interface. It
- Back-end
- Concept
description: "API is an acronym that means Application Programming Interface. It
is a code structure that meets some requirements, following development standards
and patterns, facilitating the organization of large systems. It provides functionalities
and information for applications and websites. For example: the Post Office API
that provides ZIP code and address queries in a simplified manner.'
that provides ZIP code and address queries in a simplified manner."
- title: Argument
tags:
- Concept
- Concept
description: An argument is a value or piece of information that you provide to
a function or method during its call. These arguments are used by the function
to perform a specific task or to make decisions based on the values provided.
In short, arguments are input data that allows a function to do its job and produce
a desired result or perform desired actions.
- title: Artificial Intelligence
tags:
- Artificial intelligence
- Concept
- Artificial intelligence
- Concept
description: Also called AI, it is a field of computer science that studies how
computers can simulate human intelligence and cognition. It focuses on developing
systems capable of performing tasks that could previously only be done by humans,
Expand All @@ -67,28 +67,28 @@
learning, natural language processing, computer vision, among others.
- title: Artificial Neural Network
tags:
- Artificial intelligence
- Concept
- Neural network
- Artificial intelligence
- Concept
- Neural network
description: It is a computational model inspired by the central nervous system
of an animal, which consists of a set of interconnected processing units, called
artificial neurons, that simulate the way neurons communicate with each other.
Artificial neural networks (ANNs) are used to solve complex and non-linear problems,
such as pattern recognition, speech recognition, computer vision, among others.
- title: Autoencoder
tags:
- Artificial intelligence
- Concept
- Neural network
- Artificial intelligence
- Concept
- Neural network
description: It is a type of artificial neural network composed of two neural networks
in the encoder-decoder format, being one responsible for encoding input data into
a latent space and the other for decoding data from a latent space back into the
input space. It is often used to compress input data in applications such as image
and video compression, dimensionality reduction, and data augmentation.
- title: Automatic Speech Recognition
tags:
- Artificial intelligence
- Concept
- Artificial intelligence
- Concept
description: A field of artificial intelligence that focuses on developing systems
that can analyze and understand human speech, allowing computers to transcribe
and process audio stimuli into text. Automatic speech recognition and natural
Expand All @@ -100,10 +100,9 @@
and more.
- title: AWS Commit
tags:
- Tool
- Versioning
- Tool
- Versioning
description: AWS Commit is Amazon's (AWS) source code hosting platform and is fully
integrated with the AWS ecosystem, allowing easy automation and integration with
other AWS services, such as CodePipeline (for CI/CD), IAM (permission control),
and CloudWatch (monitoring).

18 changes: 6 additions & 12 deletions _data/en-us/b.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
tags:
- Artificial intelligence
- Concept
description:
Batch size is a hyperparameter of machine learning models that controls
description: Batch size is a hyperparameter of machine learning models that controls
the number of examples used in a single run of the model. It is used to control
how quickly a machine learning model learns and can be tuned to improve its performance.
A very small batch size during training requires less memory but more iterations
Expand All @@ -13,17 +12,15 @@
tags:
- Tool
- Versioning
description:
Like GitHub, BitBucket is also a source code hosting platform and also
description: Like GitHub, BitBucket is also a source code hosting platform and also
has integrated CI/CD tools, but it integrates especially well with Atlassian tools,
such as Jira, and supports Git and Mercurial repositories, while GitHub only supports
Git.
- title: Blue-green deployment
tags:
- Concept
- Devops
description:
"Blue-green deployment is a deployment strategy that consists of having
description: "Blue-green deployment is a deployment strategy that consists of having
a replica of the production environment. New software versions are deployed to
this replica, and after deployment, user traffic is switched to the environment
with the new version, thus releasing access to this new version for all users.
Expand All @@ -38,8 +35,7 @@
tags:
- Concept
- Cybersecurity
description:
"A botnet is a network of internet-connected devices infected with
description: "A botnet is a network of internet-connected devices infected with
malware (malware is a malicious program that affects a device), allowing cybercriminals
to take down websites using this network of devices. The devices can range from
a computer to an IoT device (an IoT device is a device connected to the internet
Expand All @@ -49,16 +45,14 @@
tags:
- Concept
- Versioning
description:
A branch is like a copy of your project at a specific point in time.
description: A branch is like a copy of your project at a specific point in time.
It's like you create a separate version to work on new ideas without touching
the main version. Each Branch can be edited separately, allowing you to develop
new things without disturbing the main code.
- title: Bug
tags:
- Concept
description:
The term Bug is commonly used to inform that there is a problem in
description: The term Bug is commonly used to inform that there is a problem in
the program or environment. It can be incorrect or unexpected behavior, usually
caused by incorrect logic in the code, causing failures during the execution of
a software.
Loading
Loading