Skip to content

Commit 4b4e59b

Browse files
committed
Initial commit
0 parents  commit 4b4e59b

21 files changed

+1206
-0
lines changed

.github/CODEOWNERS

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# This is a comment.
2+
# Each line is a file pattern followed by one or more owners.
3+
4+
# These owners will be the default owners for everything in
5+
# the repo. Unless a later match takes precedence,
6+
# @global-owner1 and @global-owner2 will be requested for
7+
# review when someone opens a pull request.
8+
# * @global-owner1 @global-owner2
9+
10+
11+
* @tryber/pr-locker

.github/workflows/main.yml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
on:
2+
workflow_dispatch:
3+
inputs:
4+
dispatch_token:
5+
description: 'Token that authorize the dispatch'
6+
required: true
7+
head_sha:
8+
description: 'Head commit SHA that dispatched the workflow'
9+
required: true
10+
pr_author_username:
11+
description: 'Pull Request author username'
12+
required: true
13+
pr_number:
14+
description: 'Pull Request number that dispatched the workflow'
15+
required: true
16+
17+
jobs:
18+
evaluator:
19+
runs-on: self-hosted
20+
steps:
21+
- name: Fetch project repository
22+
uses: actions/checkout@v2
23+
24+
- name: Fetch Blocked Files Checkout action
25+
uses: actions/checkout@v2
26+
with:
27+
repository: betrybe/blocked-files-checkout-action
28+
ref: v2
29+
token: ${{ secrets.GIT_HUB_PAT }}
30+
path: .github/actions/blocked-files-checkout
31+
32+
- name: Fetch Flake8 linter
33+
uses: actions/checkout@v2
34+
with:
35+
repository: betrybe/flake8-linter-action
36+
ref: v1.3
37+
token: ${{ secrets.GIT_HUB_PAT }}
38+
path: .github/actions/flake8-linter
39+
40+
- name: Fetch PyTest evaluator
41+
uses: actions/checkout@v2
42+
with:
43+
repository: betrybe/pytest-evaluator-action
44+
ref: v5
45+
token: ${{ secrets.GIT_HUB_PAT }}
46+
path: .github/actions/pytest-evaluator
47+
48+
- name: Fetch Store evaluation
49+
uses: actions/checkout@v2
50+
with:
51+
repository: betrybe/store-evaluation-action
52+
ref: v4
53+
token: ${{ secrets.GIT_HUB_PAT }}
54+
path: .github/actions/store-evaluation
55+
56+
- name: Setup NodeJS
57+
uses: actions/[email protected]
58+
with:
59+
node-version: '14'
60+
61+
- name: Restore protected files
62+
uses: ./.github/actions/blocked-files-checkout
63+
with:
64+
restore_branch: 'master'
65+
66+
- name: Run Flake8 linter
67+
id: flake8_linter
68+
uses: ./.github/actions/flake8-linter
69+
with:
70+
token: ${{ secrets.GITHUB_TOKEN }}
71+
pr_number: ${{ github.event.inputs.pr_number }}
72+
73+
- name: Run PyTest evaluation
74+
id: evaluator
75+
uses: ./.github/actions/pytest-evaluator
76+
with:
77+
pr_author_username: ${{ github.event.inputs.pr_author_username }}
78+
79+
- name: Run Store evaluation
80+
uses: ./.github/actions/store-evaluation
81+
with:
82+
evaluation-data: ${{ steps.evaluator.outputs.result }}
83+
environment: staging
84+
pr-number: ${{ github.event.inputs.pr_number }}

.gitignore

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
# Created by https://www.toptal.com/developers/gitignore/api/python
2+
# Edit at https://www.toptal.com/developers/gitignore?templates=python
3+
4+
### Python ###
5+
# Byte-compiled / optimized / DLL files
6+
__pycache__/
7+
*.py[cod]
8+
*$py.class
9+
10+
# C extensions
11+
*.so
12+
13+
# Distribution / packaging
14+
.Python
15+
build/
16+
develop-eggs/
17+
dist/
18+
downloads/
19+
eggs/
20+
.eggs/
21+
lib/
22+
lib64/
23+
parts/
24+
sdist/
25+
var/
26+
wheels/
27+
pip-wheel-metadata/
28+
share/python-wheels/
29+
*.egg-info/
30+
.installed.cfg
31+
*.egg
32+
MANIFEST
33+
34+
# PyInstaller
35+
# Usually these files are written by a python script from a template
36+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
37+
*.manifest
38+
*.spec
39+
40+
# Installer logs
41+
pip-log.txt
42+
pip-delete-this-directory.txt
43+
44+
# Unit test / coverage reports
45+
htmlcov/
46+
.tox/
47+
.nox/
48+
.coverage
49+
.coverage.*
50+
.cache
51+
nosetests.xml
52+
coverage.xml
53+
*.cover
54+
*.py,cover
55+
.hypothesis/
56+
.pytest_cache/
57+
pytestdebug.log
58+
59+
# Translations
60+
*.mo
61+
*.pot
62+
63+
# Django stuff:
64+
*.log
65+
local_settings.py
66+
db.sqlite3
67+
db.sqlite3-journal
68+
69+
# Flask stuff:
70+
instance/
71+
.webassets-cache
72+
73+
# Scrapy stuff:
74+
.scrapy
75+
76+
# Sphinx documentation
77+
docs/_build/
78+
doc/_build/
79+
80+
# PyBuilder
81+
target/
82+
83+
# Jupyter Notebook
84+
.ipynb_checkpoints
85+
86+
# IPython
87+
profile_default/
88+
ipython_config.py
89+
90+
# pyenv
91+
.python-version
92+
93+
# pipenv
94+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
95+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
96+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
97+
# install all needed dependencies.
98+
#Pipfile.lock
99+
100+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
101+
__pypackages__/
102+
103+
# Celery stuff
104+
celerybeat-schedule
105+
celerybeat.pid
106+
107+
# SageMath parsed files
108+
*.sage.py
109+
110+
# Environments
111+
.env
112+
.venv
113+
env/
114+
venv/
115+
ENV/
116+
env.bak/
117+
venv.bak/
118+
pythonenv*
119+
120+
# Spyder project settings
121+
.spyderproject
122+
.spyproject
123+
124+
# Rope project settings
125+
.ropeproject
126+
127+
# mkdocs documentation
128+
/site
129+
130+
# mypy
131+
.mypy_cache/
132+
.dmypy.json
133+
dmypy.json
134+
135+
# Pyre type checker
136+
.pyre/
137+
138+
# pytype static type analyzer
139+
.pytype/
140+
141+
# profiling data
142+
.prof
143+
144+
# End of https://www.toptal.com/developers/gitignore/api/python

.trybe/requirements.json

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
{
2+
"requirements": [
3+
{
4+
"identifier": "test_validar_melhor_horario_com_sucesso",
5+
"description": "1.1 - Retorne, para uma entrada específica, a quantidade de estudantes presentes",
6+
"bonus": false
7+
},
8+
{
9+
"identifier": "test_validar_permanence_periods_com_entradas_invalidas",
10+
"description": "1.2 - Retorne `None` se em `permanence_period` houver alguma entrada inválida",
11+
"bonus": false
12+
},
13+
{
14+
"identifier": "test_validar_target_time_com_vazio",
15+
"description": "1.3 - Retorne `None` se `target_time` recebe um valor vazio",
16+
"bonus": false
17+
},
18+
{
19+
"identifier": "test_validar_tempo_schedule",
20+
"description": "1.4 - A função poderá, em menos que 0.02s, ser executada 10.000 vezes para uma entrada pequena (tempo da execução do avaliador no Pull Request)",
21+
"bonus": false
22+
},
23+
{
24+
"identifier": "test_validar_se_a_palavra_e_um_palindromo_retorna_true",
25+
"description": "2.1 - Retorne `true` se a palavra passada por parâmetro for um palíndromo",
26+
"bonus": false
27+
},
28+
{
29+
"identifier": "test_validar_se_a_palavra_nao_e_um_palindromo_retorna_false",
30+
"description": "2.2 - Retorne `false` se a palavra passada por parâmetro não for um palíndromo",
31+
"bonus": false
32+
},
33+
{
34+
"identifier": "test_validar_se_nao_passar_palavra_retorna_false",
35+
"description": "2.3 - Retorne `false` se nenhuma palavra for passada por parâmetro",
36+
"bonus": false
37+
},
38+
{
39+
"identifier": "test_validar_se_as_palavras_sao_um_anagrama",
40+
"description": "3.1 - Retorne `true` se as palavras passadas forem anagramas",
41+
"bonus": false
42+
},
43+
{
44+
"identifier": "test_validar_se_as_palavras_nao_sao_um_anagrama",
45+
"description": "3.2 - Retorne `false` se as palavras passadas por parâmetro não forem anagramas",
46+
"bonus": false
47+
},
48+
{
49+
"identifier": "test_valida_palavra_em_branco_retorna_false",
50+
"description": "3.3 - Retorne `false` se alguma das palavras passadas por parâmetro for uma string vazia",
51+
"bonus": false
52+
},
53+
{
54+
"identifier": "test_validar_tempo_anagrama",
55+
"description": "3.4 - Execute a função, somando 10.000 execuções para uma entrada pequena, em menos que 8.2s (tempo da execução do avaliador no Pull Request)",
56+
"bonus": false
57+
},
58+
{
59+
"identifier": "test_validar_se_encontra_numeros_repetidos",
60+
"description": "4.1 - Retorne o número repetivo se a função receber, como parâmetro, uma lista com números repetidos",
61+
"bonus": true
62+
},
63+
{
64+
"identifier": "test_validar_se_retorna_false_quando_nao_envia_valores",
65+
"description": "4.2 - Retorne `false` se a função não receber nenhum parâmetro",
66+
"bonus": true
67+
},
68+
{
69+
"identifier": "test_validar_se_retorna_false_quando_envia_string",
70+
"description": "4.3 - Retorne `false` se a função receber, como parâmetro, uma string",
71+
"bonus": true
72+
},
73+
{
74+
"identifier": "test_validar_se_retorna_false_quando_nao_ha_repeticao",
75+
"description": "4.4 - Retorne `false` se a função receber, como parâmetro, uma lista sem números repetidos",
76+
"bonus": true
77+
},
78+
{
79+
"identifier": "test_validar_se_retorna_false_quando_passa_um_valor_apenas",
80+
"description": "4.5 - Retorne `false` se a função receber, como parâmetro, apenas um valor",
81+
"bonus": true
82+
},
83+
{
84+
"identifier": "test_validar_se_retorna_false_quando_passa_numero_negativo",
85+
"description": "4.6 - Retorne `false` se a função receber, como parâmetro, um número negativo",
86+
"bonus": true
87+
},
88+
{
89+
"identifier": "test_validar_tempo_duplicate",
90+
"description": "4.7 - Execute a função, somando 10.000 execuções para uma entrada pequena, em menos que 0.01s (tempo da execução do avaliador no Pull Request)",
91+
"bonus": true
92+
},
93+
{
94+
"identifier": "test_validar_se_a_palavra_e_um_palindromo_iterativo_retorna_true",
95+
"description": "5.1 - Retorne `true` se a palavra passada como parâmetro for um palíndromo, executando uma função iterativa",
96+
"bonus": true
97+
},
98+
{
99+
"identifier": "test_validar_se_a_palavra_nao_e_um_palindromo_iterativo_retorna_false",
100+
"description": "5.2 - Retorne true se a palavra passada como parâmetro for um palíndromo, executando uma função iterativa",
101+
"bonus": true
102+
},
103+
{
104+
"identifier": "test_validar_se_nao_passar_palavra_iterativa_retorna_false",
105+
"description": "5.3 - Retorne `false` se nenhuma palavra for passada como parâmetro, executando uma função iterativa",
106+
"bonus": true
107+
},
108+
{
109+
"identifier": "test_validar_tempo_iterative",
110+
"description": "5.4 - Execute a função, somando 10.000 execuções para uma entrada pequena, em menos que 0.005s (tempo da execução do avaliador no Pull Request)",
111+
"bonus": true
112+
}
113+
]
114+
}

0 commit comments

Comments
 (0)