Package: cc-codechecker
Table of Contents:PurposeInstallUsageBasic exampleAdvanced exampleContributingComplete configuration referenceFirst levelProject referenceChallenge referencePurposeUsecodecheckerto manage coding challenge hosted entirely on Github. This have as advantage that every one can apply to the challenge easily, we can use the already implemented Github social coding suites like issues, pull requests, pages and actions and users are invited to populate their Github profiles with repository that shows their skills.In 2022, coding challenges are even used to determine what kind of employee companies might hire. Being able to create coding challenges and make them easy to access could mean more potentially developers to admit to a more advanced interview.Other repository hosting sites are not supported at the moment. Return here in the future or startcontributing.InstallYou can install codechecker usingpip:pip install cc_codecheckerUsageUsing codechecker for a coding challenge is very simple.Init a new challenge inside your current repository using the facility:cc_codechecker initThis command will create a new.codechecker.ymlfile inside your root directory. Obv, you can create that file by your own. Then, specify what programming languages you support and how you support them! You can declare, for example:What version of specified language you support (not implemented)What dialect of specified language you support (not implemented)How many points you assign for each problem solved (not implemented)More features will be added. Return here in the future or startcontributing.> We enforce the use of.preceding codechecker files inside challenge repository to make it hidden by default on many know system, to let users focus more and better on the challenge.Warning! Running init command in a repository that already hold a configuration file return anEX_CANTCREATE(73)error. To overwrite current configuration, run with the option--overwrite-yml.Basic exampleThe following code can be considered the minimum configuration for a challenge.For the simplest example of codechecker use this short configuration:challenge: base
project: bashThis represent the following folder structure:- <challenge-name>/
    - bash/
        - program.sh
    - .codechecker.yml
    - README.mdThis basic example shows how to prepare a challenge that supports onlybashlanguage with only one challenge calledbase. Executing a score keeping command, likecc_codechecker run, inside this repo will means:Start collecting points for the challengebaseTry to runbashprogram insidebashfolder without any argument without expecting any outputGive no points to users, commenting only if the challenge was completed or not> You can use codechecker in tandem with the related Github Action to collect that score file and create a Github Pages landing page for your challenge.Advanced exampleThe following code is used for a challenge supporting many languages and assigning more points for more difficult challenges.For the simplest example of codechecker inside the yaml file write this code:# Project definitions (for any challenge declared)
projects:
  # Project with custom folder name
  - language: 'bash'
    folder: 'for-shell-lovers'

  # Simple project
  - language: csharp

# Challenges definitions
challenges:
  # Simple challenge (doesn't score points)
  - name: challenge1

  # Challenge with value (score points)
  - value: 1

  # Challenge that take input from file
  - name: challenge3
    argument: input_challenge3.txt
    result: result_challenge3.txt

  # Challenge that take input from array
  - name: challenge4
    arguments: [1, 1]
    results: [2]

  # Challenge with additional projects
  - value: 5
    argument: input_challenge5.txt
    result: result_challenge5.txt
    projects: [!csharp]

  # Challenge with additional complex projects
  - argument: input6.txt
    result: result6.txt
    projects: [csharp]This configuration means the following folder structure:- <challenge-name>-solutions/
    - input_challenge3.txt
    - result_challenge3.txt
    - input_challenge4.txt
    - result_challenge4.txt
    - input5.txt
    - result5.txt

- <challenge-name>/
    - for-shell-lovers/
        - script.sh
    - csharp/
        - csharp.csproj
        - program.cs
    - .codechecker.yml
    - readmeThis is a really complex configuration that can be explained as following:Compute the first challenge named challenge1
a. Try to execute the projectfor-shell-loverscoded with bash language without any input, without collecting any results
b. Try to execute the projectcsharpwithout any input, without collecting any resultCompute the second challenge that assign 1 points
a. Iffor-shell-loversexit with a successfully result, mark challenge as resolved
b. Ifcsharpexit with a successfully result, mark challenge as resolved
c. If the challenge is marked as resolved, assign pointsCompute the third challenge that doesn’t assign any points
a. Get the content of the file input_challenge3.txt and copy it in the same folder of the projectfor-shell-loversas input.txt
b. Iffor-shell-loversexit with a successfully result giving as input the current relative path to the copied file, check it’s content and if correspond to the contents of the file result_challenge3.txt, mark challenge as resolved
c. Ifcsharpexit with a successfully result giving as input the current relative path to the copied file, check it’s content and if correspond to the contents of the file result_challenge3.txt, mark challenge as resolved
d. If the challenge is marked as resolved, assign pointsCompute the fourth challenge that doesn’t assign any points. This challenge instead giving files as inputs, give data as argumentsCompute the fifth challenge that assign 5 points, without executing csharp project, permitting users to resolve this challenge using only bash languageCompute the sixth challenge that doesn’t assign any points only for bash language!:The option for excluding or including projects is not implemented yet.ContributingContributions are welcome! Check outContributing Guidelines.Complete configuration referenceAll features listed here are implemented. This is not a code documentation.First levelchallengesDefine each step of the challenge, assigning to each of them. This isrequiredin each configuration.outputDefine the name of the output score file name.projectsDefine the list of projects inside the repository. This isrequiredin each configuration.
See Project for option reference of this yaml section.Project referencelanguageDefine the programming language for the project. This isrequiredfor each project.Supported programming languages are:Bash, usingbash(other sh dialect for small things work the same, but are not tested)CSharp, usingdotnetChallenge referenceDefine a step of the challenge.It can assign points to score the attempt.nameDefine the name of the challenge. Use in challenge run report.valuePoints to assign completing the challenge. Don’t give value if you don’t wan’t to evaluate that step.argumentName of the file to give as input to the challenge. Giving input exclude inputs.resultName of the file to give as result checker. Giving result exclude results.argumentsArray of items to give as input to the challenge. Giving inputs exclude input.resultsArray of items to give as result checker.