Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ <h1><a href="{{ '/' | relative_url }}">{{ site.title | default: site.github.repo

{% if site.email %}
<p class="addr"><i class="fa-solid fa-envelope"></i>&nbsp;<a href="mailto:{{site.email}}">{{ site.email }}</a></p>
{% endif %}
{% endif %}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.6.0/languages/awk.min.js"></script>
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.6.0/languages/awk.min.js"></script>
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,4 @@
aria-label="Copied!">Copy</button>
</div>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<h2>Others</h2>
<div><ul><li><a href="{{ '/coverage' | relative_url }}">coverage</a></li></ul></div>
<div><ul><li><a href="{{ '/coverage' | relative_url }}">coverage</a></li></ul></div>
38 changes: 19 additions & 19 deletions .competitive-verifier/docs/static/installer.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(async function () {
(async () => {
/**
* @param {string[]} lines
* @return {string} string with head space
Expand All @@ -23,15 +23,15 @@
function yamlTextProperty(name, text) {
const arr = text.split(/\r?\n/)
arr.splice(0, 0, `${name}: |`)
return arr.join('\n' + inputStringHeadSpace)
return arr.join(`\n${inputStringHeadSpace}`)
}

/**
* @param {number} size
* @return {string} yaml array
*/
function parallelIndexMatrix(size) {
if (isNaN(size)) {
if (Number.isNaN(size)) {
throw new Error('Parallel size must be integer.')
} else if (size < 1) {
throw new Error('Parallel size must be positive.')
Expand Down Expand Up @@ -100,7 +100,7 @@
function buildActionYaml() {
try {
const branch = inputBranch.value.trim()
const parallelSize = parseInt(inputParallelSize.value.trim())
const parallelSize = parseInt(inputParallelSize.value.trim(), 10)
const configToml = inputConfigToml.value.trim()
const include = inputInclude.value.trim()
const exclude = inputExclude.value.trim()
Expand Down Expand Up @@ -212,11 +212,11 @@
' run: dotnet tool install -g CompetitiveVerifierCsResolver',
'# required only if you have unit test.',
'- name: Unit test',
' run: dotnet test $UNITTEST_CSPROJ --logger "CompetitiveVerifier;OutDirectory=${{runner.temp}}/VerifierCsUnitTestResult" --no-build -c Release',
` run: dotnet test $UNITTEST_CSPROJ --logger "CompetitiveVerifier;OutDirectory=\${{runner.temp}}/VerifierCsUnitTestResult" --no-build -c Release`,
' env:',
' UNITTEST_CSPROJ: YourUnittest.csproj',
'- name: Resolve',
' run: dotnet run --project $VERIFY_CSPROJ --no-launch-profile --no-build -c Release | tee ${{runner.temp}}/problems.json',
` run: dotnet run --project $VERIFY_CSPROJ --no-launch-profile --no-build -c Release | tee \${{runner.temp}}/problems.json`,
' env:',
' VERIFY_CSPROJ: YourVerify.csproj',
'- name: cs-resolve',
Expand All @@ -227,8 +227,8 @@
' # Specify patterns',
includeParam,
excludeParam,
' unittest-result: ${{runner.temp}}/VerifierCsUnitTestResult/*.csv',
' problems: ${{runner.temp}}/problems.json',
` unittest-result: \${{runner.temp}}/VerifierCsUnitTestResult/*.csv`,
` problems: \${{runner.temp}}/problems.json`,
)

initializeForVerification.push(...setup)
Expand Down Expand Up @@ -304,7 +304,7 @@ jobs:
`

if (initializeForResolving.length > 0) {
actionYaml += stepDefinition([" # Initialize your own environment for resolving.", ...initializeForResolving]) + "\n"
actionYaml += `${stepDefinition([" # Initialize your own environment for resolving.", ...initializeForResolving])}\n`
}

actionYaml += `
Expand All @@ -329,7 +329,7 @@ jobs:
runs-on: ubuntu-latest
needs: [setup]
env:
SPLIT_SIZE: "${parseInt(inputParallelSize.value.trim())}"
SPLIT_SIZE: "${parallelSize}"
strategy:
matrix:
# prettier-ignore
Expand Down Expand Up @@ -364,7 +364,7 @@ jobs:
cache-pip: true
`
if (initializeForVerification.length > 0) {
actionYaml += stepDefinition([" # Initialize your own environment for verification.", ...initializeForVerification]) + "\n"
actionYaml += `${stepDefinition([" # Initialize your own environment for verification.", ...initializeForVerification])}\n`
}

actionYaml += `
Expand Down Expand Up @@ -404,14 +404,14 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 2147483647

- name: Download verify_files.json and all artifacts
id: all-artifacts
uses: competitive-verifier/actions/download-verify-artifact@v2
with:
download-all: true
artifact-root: .artifacts/

- name: Extract bundled
shell: bash
run: |
Expand All @@ -424,7 +424,7 @@ jobs:
fi
env:
SRCDIR: .artifacts/Bundled-\${{ runner.os }}

- name: Set up competitive-verifier
uses: competitive-verifier/actions/setup@v2
with:
Expand Down Expand Up @@ -602,7 +602,7 @@ jobs:
outputCreateActionLink.href = createUrl

const editUrl = `${repoRoot}/edit/${inputBranch.value}/.github/workflows/verify.yml`;
(async function () {
(async () => {
const editResponse = await fetch(`https://api.github.com/repos/${repoUser}/${repoName}/contents/.github/workflows/verify.yml`)
if (editResponse.ok)
outputCreateActionLink.href = editUrl
Expand All @@ -612,8 +612,8 @@ jobs:
const badgeVerifyRaw = document.getElementById('badge-verify-raw')
const badgeVerifyLink = document.getElementById('badge-verify-link')
const badgeVerifyImg = document.getElementById('badge-verify-img')
const link = repoRoot + "/actions"
const img = repoRoot + "/actions/workflows/verify.yml/badge.svg"
const link = `${repoRoot}/actions`
const img = `${repoRoot}/actions/workflows/verify.yml/badge.svg`
badgeVerifyRaw.value = `[![Actions Status](${img})](${link})`
badgeVerifyLink.href = link
badgeVerifyImg.src = img
Expand Down Expand Up @@ -646,9 +646,9 @@ jobs:
if (repsitory.endsWith('.git')) {
repsitory = repsitory.substring(0, repsitory.length - 4)
}
let found = repsitory.match(/github.com\/([^\/]+)\/([^\/]+)$/)
let found = repsitory.match(/github.com\/([^/]+)\/([^/]+)$/)
if (!found) {
found = repsitory.match(/^([^\/]+)\/([^\/]+)$/)
found = repsitory.match(/^([^/]+)\/([^/]+)$/)
}
return found
}
Expand Down
55 changes: 55 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
root = true

[*]
indent_style = space
indent_size = 4

end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

# Common binary files
[*.{png,jpg,jpeg,gif,webp,ico,pdf,zip,gz,tar,7z,jar,war,class,exe,dll,so,dylib,woff,woff2,ttf,eot}]
end_of_line = unset
charset = unset
trim_trailing_whitespace = unset
insert_final_newline = unset

# Markdown
[*.{md,mdx}]
indent_size = 2
trim_trailing_whitespace = false

# Generated Python and C / C++ binary files
[*.{a,lib,o,obj,pyc,pyo,pyd}]
end_of_line = unset
charset = unset
trim_trailing_whitespace = unset
insert_final_newline = unset

# Shell
[*.{sh,bash,zsh}]
indent_size = 2

# YAML
[*.{yml,yaml}]
indent_size = 2

# Generated JSON schema files
[*.schema.json]
indent_size = 2

# Git bundle files
[*.bundle]
end_of_line = unset
charset = unset
trim_trailing_whitespace = unset
insert_final_newline = unset

# Test fixtures
[*.{hello,in,out,txt}]
end_of_line = unset
charset = unset
trim_trailing_whitespace = unset
insert_final_newline = unset
111 changes: 104 additions & 7 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,10 +1,107 @@
* text=auto eol=lf

*.bundle binary
*.gif binary
*.ico binary
*.jpg binary
*.jpeg binary
*.png binary
*.woff binary
# Common binary files
*.png binary
*.jpg binary
*.jpeg binary
*.gif binary
*.webp binary
*.ico binary
*.pdf binary
*.zip binary
*.gz binary
*.tar binary
*.7z binary
*.jar binary
*.war binary
*.class binary
*.exe binary
*.dll binary
*.so binary
*.dylib binary
*.woff binary
*.woff2 binary
*.ttf binary
*.eot binary

# Markdown
*.md text diff=markdown whitespace=-blank-at-eol
*.mdx text diff=markdown whitespace=-blank-at-eol

# Python
*.py text diff=python
*.pyi text diff=python
*.pyw text diff=python

# C / C++
*.c text diff=cpp
*.cc text diff=cpp
*.cpp text diff=cpp
*.cxx text diff=cpp
*.h text diff=cpp
*.hh text diff=cpp
*.hpp text diff=cpp
*.hxx text diff=cpp
*.ipp text diff=cpp
*.tpp text diff=cpp
*.ixx text diff=cpp
*.cppm text diff=cpp

# Generated Python and C / C++ binary files
*.a binary
*.lib binary
*.o binary
*.obj binary
*.pyc binary
*.pyo binary
*.pyd binary

# Shell
*.sh text diff=bash
*.bash text diff=bash
*.zsh text diff=bash

# Java
*.java text diff=java

# Go
*.go text diff=golang

# Rust
*.rs text diff=rust

# Awk
*.awk text

# HTML
*.html text diff=html

# CSS
*.css text diff=css
*.scss text diff=css

# JavaScript
*.js text

# JSON
*.json text

# YAML
*.yml text
*.yaml text

# Configuration and lock files
*.toml text
*.lock text

# Git bundle files
*.bundle binary

# Test fixtures
*.hello text -eol
*.in text -eol
*.out text -eol
*.txt text=auto -eol

# Vendored documentation assets
src/competitive_verifier_resources/jekyll/assets/vendor/** linguist-vendored -text -eol
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@
"console": "integratedTerminal"
},
]
}
}
2 changes: 1 addition & 1 deletion examples/awk/aplusb.awk
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# competitive-verifier: TITLE Calculate "A + B"
function add(a, b) {
return a + b;
}
}
2 changes: 1 addition & 1 deletion examples/awk/aplusb2.awk
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# competitive-verifier: LOCALCASE //examples/data/aplusb
$0=$1+$2
$0=$1+$2
4 changes: 2 additions & 2 deletions examples/cpp/segment_tree.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include "examples/cpp/monoids.hpp"

/**
* @brief a Segment Tree (generalized with monoids)
* @brief a Segment Tree (generalized with monoids)
* @tparam Monoid is a monoid; commutativity is not required
* @see https://en.wikipedia.org/wiki/Segment_tree
*/
Expand Down Expand Up @@ -50,4 +50,4 @@ struct segment_tree {

typedef segment_tree<plus_monoid> plus_segment_tree;
typedef segment_tree<max_monoid> max_segment_tree;
typedef segment_tree<min_monoid> min_segment_tree;
typedef segment_tree<min_monoid> min_segment_tree;
2 changes: 1 addition & 1 deletion examples/external/verify_files.json
Original file line number Diff line number Diff line change
Expand Up @@ -117,4 +117,4 @@
}
}
}
}
}
12 changes: 6 additions & 6 deletions examples/go/helloworld_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
package main

import (
"./helloworld"
"testing"
"./helloworld"
"testing"
)

func TestHelloWorld(t *testing.T) {
want := "Hello World"
if got := helloworld.GetHelloWorld(); got != want {
t.Errorf("helloworld.GetHelloWorld() = %v, want %v", got, want)
}
want := "Hello World"
if got := helloworld.GetHelloWorld(); got != want {
t.Errorf("helloworld.GetHelloWorld() = %v, want %v", got, want)
}
}
Loading
Loading