Skip to content

Como organizar melhor os projetos ?#1

Merged
Ryanditko merged 8 commits into
mainfrom
projects
Jan 6, 2026
Merged

Como organizar melhor os projetos ?#1
Ryanditko merged 8 commits into
mainfrom
projects

Conversation

@Ryanditko

Copy link
Copy Markdown
Owner

Como eu poderia organizar melhor este repositório para as outras pessoas ?

Copilot AI review requested due to automatic review settings January 6, 2026 13:35

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR implements project structure improvements by adding complete implementations for two beginner-level projects in three programming languages (Python, JavaScript, and Clojure), along with comprehensive documentation and GitHub templates to better organize the repository.

Key Changes:

  • Implementation of password generator and simple calculator projects in Python, JavaScript, and Clojure
  • Addition of contribution guidelines, changelog, and GitHub issue/PR templates
  • Setup of CI/CD workflow for Python testing

Reviewed changes

Copilot reviewed 9 out of 11 changed files in this pull request and generated 12 comments.

Show a summary per file
File Description
iniciante/gerador-de-senha/script.py Python implementation of secure password generator with validation
iniciante/gerador-de-senha/script.js JavaScript implementation of password generator
iniciante/gerador-de-senha/script.clj Clojure implementation with functional programming approach
iniciante/gerador-de-senha/pycache/script.cpython-311.pyc Python bytecode file (should not be committed)
iniciante/calculadora-simples/script.py Python calculator with expression parsing and precedence handling
iniciante/calculadora-simples/script.js JavaScript calculator with CLI interface
iniciante/calculadora-simples/script.clj Clojure calculator using functional patterns
CONTRIBUTING.md Contribution guidelines for repository organization
CHANGELOG.md Project changelog documenting version history
.gitignore Updated ignore patterns for Python cache files
.github/workflows/python-tests.yml CI/CD workflow for automated Python testing
.github/pull_request_template.md Standardized PR template for contributions
.github/ISSUE_TEMPLATE/feature_request.md Feature request template
.github/ISSUE_TEMPLATE/bug_report.md Bug report template

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +30 to +34
const calc = token === '*'
? prev * next
: prev / next;

result.push(calc);

Copilot AI Jan 6, 2026

Copy link

Choose a reason for hiding this comment

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

The variable 'calc' is not descriptive and should be renamed to something more meaningful like 'result' or 'calculatedValue' to improve code readability and maintainability.

Suggested change
const calc = token === '*'
? prev * next
: prev / next;
result.push(calc);
const calculatedValue = token === '*'
? prev * next
: prev / next;
result.push(calculatedValue);

Copilot uses AI. Check for mistakes.

if (token === '*' || token === '/') {
const prev = result.pop();
const next = tokens[i + 1];

Copilot AI Jan 6, 2026

Copy link

Choose a reason for hiding this comment

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

Division by zero is not explicitly handled in the calculator logic. While the main loop catches generic errors, division by zero will result in Infinity in JavaScript, which may not be the desired behavior. Consider adding explicit validation when the divisor is zero to provide a clearer error message to users.

Suggested change
const next = tokens[i + 1];
const next = tokens[i + 1];
if (token === '/' && next === 0) {
throw new Error("Divisão por zero");
}

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,81 @@
import random as rd

Copilot AI Jan 6, 2026

Copy link

Choose a reason for hiding this comment

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

The import alias 'rd' for the random module is non-standard. Python convention suggests using either the full module name 'random' or the more common alias for random operations. Using 'rd' makes the code less readable for other developers who expect standard naming conventions.

Copilot uses AI. Check for mistakes.
Comment on lines +6 to +20
function gerarSenha(tamanho, incluirMaiusculas = true, incluirMinusculas = true, incluirNumeros = true, incluirSimbolos = true) {
let caracteresDisponiveis = "";

if (incluirMaiusculas) caracteresDisponiveis += letrasMaiusculas;
if (incluirMinusculas) caracteresDisponiveis += letrasMinusculas;
if (incluirNumeros) caracteresDisponiveis += numeros;
if (incluirSimbolos) caracteresDisponiveis += simbolos;

if (caracteresDisponiveis === "") {
return "Erro: Selecione pelo menos um tipo de caractere!";
}

let senha = "";
for (let i = 0; i < tamanho; i++) {
senha += caracteresDisponiveis.charAt(Math.floor(Math.random() * caracteresDisponiveis.length));

Copilot AI Jan 6, 2026

Copy link

Choose a reason for hiding this comment

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

Using Math.random() for password generation is cryptographically insecure. For security-sensitive operations like password generation, use the Web Crypto API (crypto.getRandomValues() in browsers or crypto.randomBytes() in Node.js) to generate cryptographically strong random values.

Copilot uses AI. Check for mistakes.
Comment on lines +36 to +37
calc = prev * next_value if token == '*' else prev / next_value
result.append(calc)

Copilot AI Jan 6, 2026

Copy link

Choose a reason for hiding this comment

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

The variable 'calc' is not descriptive and should be renamed to something more meaningful like 'result' or 'calculated_value' to improve code readability and maintainability.

Suggested change
calc = prev * next_value if token == '*' else prev / next_value
result.append(calc)
calculated_value = prev * next_value if token == '*' else prev / next_value
result.append(calculated_value)

Copilot uses AI. Check for mistakes.
Comment thread CHANGELOG.md
- Template de Pull Request
- Guia de Contribuição (CONTRIBUTING.md)
- Workflow de CI/CD com GitHub Actions
- Testes unitários para gerador de senhas Python

Copilot AI Jan 6, 2026

Copy link

Choose a reason for hiding this comment

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

The CHANGELOG references test file additions ("Testes unitários para gerador de senhas Python") that don't exist in this pull request. The workflow file references test_senha.py but this file is not included in the repository, making this changelog entry inaccurate.

Suggested change
- Testes unitários para gerador de senhas Python

Copilot uses AI. Check for mistakes.
Comment on lines +1 to +33
import random as rd
import string

def gerar_senha(tamanho, incluir_maiusculas=True, incluir_minusculas=True,
incluir_numeros=True, incluir_simbolos=True):
"""
Gera uma senha aleatória com base nos parâmetros fornecidos.

Args:
tamanho (int): Comprimento da senha
incluir_maiusculas (bool): Incluir letras maiúsculas
incluir_minusculas (bool): Incluir letras minúsculas
incluir_numeros (bool): Incluir números
incluir_simbolos (bool): Incluir símbolos especiais

Returns:
str: Senha gerada
"""
caracteres_disponiveis = ""

if incluir_maiusculas:
caracteres_disponiveis += string.ascii_uppercase
if incluir_minusculas:
caracteres_disponiveis += string.ascii_lowercase
if incluir_numeros:
caracteres_disponiveis += string.digits
if incluir_simbolos:
caracteres_disponiveis += "!@#$%^&*()_+[]{}|;:,.<>?"

if not caracteres_disponiveis:
return "Erro: Selecione pelo menos um tipo de caractere!"

senha = ''.join(rd.choice(caracteres_disponiveis) for _ in range(tamanho))

Copilot AI Jan 6, 2026

Copy link

Choose a reason for hiding this comment

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

Using the 'random' module for password generation is cryptographically insecure. For security-sensitive operations like password generation, use the 'secrets' module instead, which is designed for generating cryptographically strong random numbers suitable for managing data such as passwords, account authentication, security tokens, and related secrets.

Copilot uses AI. Check for mistakes.
Comment on lines +10 to +39
(defn gerar-senha
"Gera uma senha aleatória com base nos parâmetros fornecidos.

Parâmetros:
tamanho - Comprimento da senha (número)
opcoes - Map com chaves booleanas:
:maiusculas? - Incluir letras maiúsculas (padrão: true)
:minusculas? - Incluir letras minúsculas (padrão: true)
:numeros? - Incluir números (padrão: true)
:simbolos? - Incluir símbolos especiais (padrão: true)

Retorna:
String com a senha gerada ou mensagem de erro"
([tamanho]
(gerar-senha tamanho {}))
([tamanho {:keys [maiusculas? minusculas? numeros? simbolos?]
:or {maiusculas? true
minusculas? true
numeros? true
simbolos? true}}]
(let [caracteres-disponiveis (str/join ""
(cond-> []
maiusculas? (conj letras-maiusculas)
minusculas? (conj letras-minusculas)
numeros? (conj numeros)
simbolos? (conj simbolos)))]
(if (empty? caracteres-disponiveis)
"Erro: Selecione pelo menos um tipo de caractere!"
(str/join (repeatedly tamanho
#(rand-nth caracteres-disponiveis)))))))

Copilot AI Jan 6, 2026

Copy link

Choose a reason for hiding this comment

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

Using rand-nth for password generation is cryptographically insecure. Clojure's rand-nth uses a pseudo-random number generator that is not suitable for security-sensitive operations. For password generation, consider using Java's SecureRandom class through Java interop for cryptographically strong random values.

Copilot uses AI. Check for mistakes.
Comment on lines +1 to +2
import re

Copilot AI Jan 6, 2026

Copy link

Choose a reason for hiding this comment

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

Import of 're' is not used.

Suggested change
import re

Copilot uses AI. Check for mistakes.
(if (empty? caracteres-disponiveis)
"Erro: Selecione pelo menos um tipo de caractere!"
(str/join (repeatedly tamanho
#(rand-nth caracteres-disponiveis)))))))

Copilot AI Jan 6, 2026

Copy link

Choose a reason for hiding this comment

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

A função gerar-senha usa rand-nth (que depende de um gerador pseudoaleatório não criptograficamente seguro) para criar senhas, o que torna os valores gerados previsíveis para um atacante que consiga observar saídas ou inferir o estado do PRNG. Como este código é explicitamente um gerador de senhas, isso enfraquece diretamente a segurança das credenciais produzidas. Use uma fonte de entropia criptograficamente segura (por exemplo, baseada em java.security.SecureRandom ou biblioteca equivalente) para selecionar caracteres da senha.

Copilot uses AI. Check for mistakes.
@Ryanditko Ryanditko closed this Jan 6, 2026
@Ryanditko Ryanditko reopened this Jan 6, 2026
@Ryanditko Ryanditko merged commit 2257f62 into main Jan 6, 2026
@Ryanditko Ryanditko deleted the projects branch February 15, 2026 04:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants