Coder Social home page Coder Social logo

kata-formulation-find-comments's Introduction

Find the comments kata

This a formulation for your practice

Formulation

Little Johnny is inspecting a PHP source code that contains comments. These comments contains words that he doesn't understand, as it written in another language.

Rules and constraints

The source code in the PHP files does not need to be correct.

A comment (a subset of PHP comments) is defined as:

  • A line containing C-style comment delimiter, except when it is within a string
    • // hello C-style is a valid comment
    • echo "//"; is not a comment
    • echo '//'; is not a comment
  • A line containing Perl-style comment delimiter, except when it is within a string
    • # hello Perl-style is a valid comment
    • echo "#"; is not a comment
    • echo '#'; is not a comment
  • There are no multi-line comments
    • /* ... */ is not a comment

You can do this kata in any language you want. In any case it is not allowed to use a PHP parser. This task must be done manually.

How to start

  • Clone/fork (any stars are welcome) this repo
  • Run the tests. See this for help
  • They should be red.
  • Go to production code and fix it
  • Have fun (happy kata and happy koding!)

Requirements

Please do not read ahead, just read the current assignment, do it, then read the next one:

  1. Can you help Little Johnny fetch all those comments?
  2. These messages have not been audited yet and we want to publish the code, so it is better to remove the comments. Can you do it?

Optional requirement

As an optional task, when the problem is finished (you can attack in your preferred order), there must be an executable jar with some parameters to process the current folder with the 'working modes' specified above.

This section is a copy from here. Raw source

Tests

This section is a copy from here

Testing from the CLI

lein midje :autotest

This has the advantage that loads everything, each time.

Testing inside the REPL

lein repl
(use 'midje.repl)
(autotest)

This has the advantage that is faster.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.