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

Conversation

george-gca
Copy link
Contributor

Descrição de PR

Ver se resolve o problema com o Prettier não rodar

Issue relacionado

Motivações

Fazer isso funcionar

Copy link

netlify bot commented Jan 16, 2025

Deploy Preview for diciotech ready!

Name Link
🔨 Latest commit 5a62992
🔍 Latest deploy log https://app.netlify.com/sites/diciotech/deploys/67a23f186549a20008413f89
😎 Deploy Preview https://deploy-preview-292--diciotech.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@george-gca
Copy link
Contributor Author

É, esgotei minhas opções de tentar aplicar a mudança no código. Enquanto isso a discussão tá lá no actions/checkout#1326.

@levxyca levxyca linked an issue Jan 17, 2025 that may be closed by this pull request
@levxyca levxyca requested review from Copilot and levxyca January 17, 2025 12:09
@levxyca levxyca added the bug Something isn't working label Jan 17, 2025
@levxyca levxyca added this to the v2 milestone Jan 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 26 out of 41 changed files in this pull request and generated no comments.

Files not reviewed (15)
  • .devcontainer/devcontainer.json: Language not supported
  • .prettierrc: Language not supported
  • _data/en-us/numbers.yml: Evaluated as low risk
  • _data/en-us/o.yml: Evaluated as low risk
  • _data/en-us/t.yml: Evaluated as low risk
  • CONTRIBUTING.md: Evaluated as low risk
  • _data/en-us/h.yml: Evaluated as low risk
  • _data/en-us/r.yml: Evaluated as low risk
  • _data/en-us/f.yml: Evaluated as low risk
  • _data/en-us/u.yml: Evaluated as low risk
  • _data/en-us/d.yml: Evaluated as low risk
  • _data/en-us/b.yml: Evaluated as low risk
  • _data/en-us/p.yml: Evaluated as low risk
  • _data/en-us/i.yml: Evaluated as low risk
  • _data/en-us/w.yml: Evaluated as low risk
@george-gca
Copy link
Contributor Author

@levxyca não aceita essa PR ainda, tô fazendo testes pra ver se consigo fazer o prettier na pr funcionar, não botei como draft porque eu acho que como draft ele não roda as github actions.

@levxyca
Copy link
Owner

levxyca commented Jan 20, 2025

@george-gca belezinha!

@george-gca
Copy link
Contributor Author

george-gca commented Feb 1, 2025

AGORA sim acho que tá pronto @levxyca. Como tava dando muito erro o outro código de aplicar o prettier direto, fui obrigado a mudar a solução pra ele rodar o prettier no código, e caso não passe, ele gera um diff do que precisa ser mudado pro código passar. Não consegui fazer ele aplicar sozinho o prettier.

Aqui tem um exemplo de quando o workflow falha. Ali embaixo ele gerou um Artifact que é um zip, dentro do zip tem um html mostrando as mudanças. Não tem como gerar só o HTML direto infelizmente.

Signed-off-by: George Araújo <[email protected]>
Signed-off-by: George Araújo <[email protected]>
Signed-off-by: George Araújo <[email protected]>
Signed-off-by: George Araújo <[email protected]>
Signed-off-by: George Araújo <[email protected]>
Signed-off-by: George Araújo <[email protected]>
Signed-off-by: George Araújo <[email protected]>
Signed-off-by: George Araújo <[email protected]>
Signed-off-by: George Araújo <[email protected]>
Signed-off-by: George Araújo <[email protected]>
Signed-off-by: George Araújo <[email protected]>
Signed-off-by: George Araújo <[email protected]>
Signed-off-by: George Araújo <[email protected]>
Signed-off-by: George Araújo <[email protected]>
Signed-off-by: George Araújo <[email protected]>
Signed-off-by: George Araújo <[email protected]>
Signed-off-by: George Araújo <[email protected]>
Signed-off-by: George Araújo <[email protected]>
Signed-off-by: George Araújo <[email protected]>
@george-gca
Copy link
Contributor Author

george-gca commented Feb 4, 2025

Acho que consegui resolver tudo agora. Eu dividi o conteúdo do _scripts/scripts.js.liquid em 2 arquivos:

  • _scripts/localized_scripts.js.liquid - só a parte que PRECISA de valores do Jekyll. Ele importa as funções necessárias do arquivo abaixo
  • assets/js/cards.js - todo o resto

O arquivo _scripts/localized_scripts.js.liquid fica com a formatação meio zoada porque o Prettier não sabe lidar com ele. Se eu uso a extensão como .liquid.js ele tenta formatar como JS e acusa erro por causa do front matter no arquivo (toda a parte entre --- inclusive ele). Se eu uso como .js.liquid ele formata como liquid e o código Javascript fica feio.

Eu resolvi isso adicionando esse arquivo pra ser ignorado por enquanto pelo Prettier. O Prettier tem até formas de ignorar código, mas não tem uma opção que serve pra esse caso. Até comentei numa issue aberta sobre isso.

Detalhe: a maioria das mudanças foi o Prettier arrumando formatação de código. Pelo menos agora vai ficar tudo bonitinho e formatado.

@levxyca
Copy link
Owner

levxyca commented Feb 5, 2025

Aeeeeeee @george-gca, já vou dar um bizu!!! A saga do Prettier é real hjahahahaha

@levxyca levxyca merged commit 27c2f45 into levxyca:main Feb 5, 2025
7 checks passed
@george-gca george-gca deleted the prettierrc branch February 5, 2025 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Workflow do prettier não consegue rodar
2 participants