Coder Social home page Coder Social logo

exercism / pharo-smalltalk Goto Github PK

View Code? Open in Web Editor NEW
33.0 16.0 28.0 2.83 MB

Exercism exercises in Pharo.

Home Page: https://exercism.org/tracks/pharo-smalltalk

License: MIT License

Shell 0.17% Smalltalk 99.38% StringTemplate 0.44%
exercism-track community-contributions-accepted

pharo-smalltalk's Introduction

Exercism Pharo Track

Build & Unit tests GitHub release Pharo 12 Pharo 11

This repository is for the development of Exercism exercises running in the Pharo Smalltalk programming environment.

If you are new to Pharo or Exercism, consider using Exercism to learn Pharo, so you can help contribute in the future.

If you already know Pharo, but would just like to help out with testing, please sign up for the track as above, review the setup documentation, and also visit the Discord channel (as described in resources).

Mentor Setup

If you are familiar with Pharo, but not quite sure about developing exercises, we are always happy to get extra help mentoring exercises.

If you sign up as a Pharo Mentor by choosing Pharo in the mentor list, you then need to update your bio and load up a special (dev-light) image.

Simply evalaluate the following in a fresh Pharo image (e.g. created from Pharo Launcher - choose latest stable release from Official distributions):

Metacello new
 baseline: 'Exercism';
 repository: 'github://exercism/pharo-smalltalk:main/releases/latest';
 load: 'mentor'

You will then find a "View Mentee Solution..." entry in the Exercism menu, which allows you to safely download a mentee code submission into your image so you can browse code and references.

To use this browser, you need to paste the download link at the bottom of a submission into the menu prompt, and it will download and show the solution.

When looking at a solution, there is also a context menu to leave comments on methods and classes, as well as an option to view a summary report that can be pasted into the mentor panel.

For maintainers

If you want to contribute by PR and produce an exercise or bugfix, follow Contributing guidelines.

pharo-smalltalk's People

Contributors

bajger avatar bencoman avatar bnandras avatar carlotxra avatar chicoary avatar citizen428 avatar dependabot[bot] avatar edward avatar ee7 avatar erikschierboom avatar exercism-bot avatar fuhrmanator avatar glennj avatar gypsydave5 avatar ihid avatar kytrinyx avatar macta avatar marianoastor avatar raydeejay avatar roelofwobben avatar samwson avatar saschamann avatar socallongboard avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pharo-smalltalk's Issues

Update the Pharo track intro text and provide a sample snippet

When you first view the Pharo track, you are presented wit a concise summary of the language and why its important as well as simple code snippet.

We need to update the /docs/about.md and /docs/snippet.txt to wow people about Pharo and importance of Smalltalk

When you startup - maybe we should give a better welcome wizard?

I tried to load a welcome class that would have all the right information - but you still need to know to click on the class comment button...

Not sure if we can click on it automatically so people can read - or if we have to launch a wizard window or text doc or something?

Ensure Pharo track is ready for v2 launch

There are a number of things we're going to want to check before the v2 site goes live. There are notes below that flesh out all the checklist items.

  • The track has a page on the v2 site: https://v2.exercism.io/tracks/pharo
  • The track page has a short description under the name (not starting with TODO)
  • The "About" section is a friendly, colloquial, compelling introduction
  • The "About" section follows the formatting guidelines
  • The code example gives a good taste of the language and fits within the boundaries of the background image
  • There are exercises marked as core
  • Exercises have rough estimates of difficulty
  • Exercises have topics associated with them
  • The first exercise is auto_approve: true

Track landing page

The v2 site has a landing page for each track, which should make people want to join it. If the track page is missing, ping @kytrinyx to get it added.

Blurb

If the header of the page starts with TODO, then submit a pull request to https://github.com/exercism/pharo/blob/master/config.json with a blurb key. Remember to get configlet and run configlet fmt . from the root of the track before submitting.

About section

If the "About" section feels a bit dry, then submit a pull request to https://github.com/exercism/pharo/blob/master/docs/ABOUT.md with suggested tweaks.

Formatting guidelines

In order to work well with the design of the new site, we're restricting the formatting of the ABOUT.md. It can use:

  • Bold
  • Italics
  • Links
  • Bullet lists
  • Number lists

Additionally:

  • Each sentence should be on its own line
  • Paragraphs should be separated by an empty line
  • Explicit <br/> can be used to split a paragraph into lines without spacing between them, however this is discouraged.

Code example

If the code example is too short or too wide or too long or too uninteresting, submit a pull request to https://github.com/exercism/ocaml/blob/master/docs/SNIPPET.txt with a suggested replacement.

Exercise metadata

Where the v1 site has a long, linear list of exercises, the v2 site has organized exercises into a small set of required exercises ("core").

If you update the track config, remember to get configlet and run configlet fmt . from the root of the track before submitting.

Topic and difficulty

Core exercises unlock optional additional exercises, which can be filtered by topic an difficulty, however that will only work if we add topics and difficulties to the exercises in the track config, which is in https://github.com/exercism/pharo/blob/master/config.json

Auto-approval

We've currently made any hello-world exercises auto-approved in the backend of v2. This means that you don't need mentor approval in order to move forward when you've completed that exercise.

Not all tracks have a hello-world, and some tracks might want to auto approve other (or additional) exercises.

Track mentors

There are no bullet points for this one :)

As we move towards the launch of the new version of Exercism we are going to be ramping up on actively recruiting people to help provide feedback. Our goal is to get to 100%: everyone who submits a solution and wants feedback should get feedback. Good feedback.

If you're interested in helping mentor the track, check out http://mentoring.exercism.io/

When all of the boxes are ticked off, please close the issue.

Tracking progress in exercism/meta#104

TonelWriter bug when generating exercises

I ran into this bug when trying to generate the exercise files (READMEs, source code etc.) for #83.

When running ExercismGenerator class>>#generate I get the following error: "Instance of RelativePath did not understand #pathString".

The problem is in the method below with the TonelWriter instance. I remember I had the same problem when working on the ExercismSubmit solution here. In that issue the code was redundant and not needed but here we need to create files and a fix will be needed.

I've noticed I can fix the error by adding the message send #asFileReference like so: packageDir: (solutionDirectoryRef relativeTo: exampleDirectoryRef) asFileReference pathString; but that still leaves the problem that #sourceDir: is not understood by ExTonelWriter or its super class. I'll carry on looking into this problem.

ExercismGenerator>>#generateSourceFilesFor: packageOrTag to: filePathString
	"Generate the Tonel source files for a package (normally a tag). Answer the exercise directory reference"

	| writer exampleDirectoryRef exerciseDirectoryRef metaDirectoryRef  solutionDirectoryRef testClass testClassFilename exerciseName |
	
	"Note: could create the writer on a memory stream to then pick what should be stored on disk
	e.g.
		mem := FileSystem memory root.
		writer := ExTonelWriter on: mem."

	exerciseName := packageOrTag name asKebabCase.
	exampleDirectoryRef := filePathString asFileReference.
	exerciseDirectoryRef := exampleDirectoryRef / exerciseName.
	metaDirectoryRef :=  exerciseDirectoryRef / '.meta'.
	solutionDirectoryRef := metaDirectoryRef / 'solution'.
	
	exerciseDirectoryRef ensureCreateDirectory.
	exerciseDirectoryRef deleteAll.
	
	(writer := ExTonelWriter new)
                "Error: Instance of RelativePath did not understand #pathString"
		packageDir: (solutionDirectoryRef relativeTo: exampleDirectoryRef) pathString;
		sourceDir: exampleDirectoryRef;
		writeSnapshot: (self createTagSnapshotFor: packageOrTag).

	"Remove the extra package file as its not needed for Exercism"
	(solutionDirectoryRef / 'package.st') delete.
	
	self generateReadmeHintFor: packageOrTag to: metaDirectoryRef.
	
	"Move the test file down to the exerciseDirectory"
	testClass := packageOrTag classes detect: [ :cls | cls isTestCase  ].
	testClassFilename := testClass name, '.class.st'.
	(solutionDirectoryRef / testClassFilename) moveTo: exerciseDirectoryRef / testClassFilename.
	
	^exerciseDirectoryRef 

Syntax highlighting for pharo

This track has not yet specified the file format mapping
for syntax highlighting in exercism/meta#90

Please provide a mapping of file formats used by your track
in exercism/meta#90 (e.g. md = markdown)

This issue can be closed after this is completed. (Apologies
if you've already done this - this issue was generated
automatically).

Downloading exercises directly into Pharo

Currently Pharo Exercism uses OSProcess to communicate with Exercism. @bencoman experimented with using a direct http connection and using the exercism protocol. This feels like a cleaner solution as shelling out to the os and parsing the osprocess result is more error prone than getting direct http results.

(We currently have a half way house where we can download directly but not yet upload)

Move Exercism student tools to this repo

Move the spike on gitlab:macta/exercism over to this repo, and update the readme instructions so that we have all of the exercises and tooling in one place. This means that exercism devs (not students) can easily contribute to the tooling as well.

Fetching the same exercise doesn't work well

The new exercism cli seems to create a suffixed new directory (e.g. -2) when you download an exercise again.

In Pharo this is invisible (your in the pharo ide).

We possibly shouldn't let you download again - or down shell out to exercism and just reload the source (which should essentially let you start again).

This needs a bit of a think

New User steps don't work - no welcome, and all exercises present

New users following the install steps should get an image with a browser showing the exercism package containing only a welcome class.

The baseline was a bit wrong, the default shouldn't load all the exercises, and we need to create an empty Exercism package and move Welcome to it on load.

Exercism | View Track Progress, should open current exercise (and work on windows)

Currently there is a beta option to open the current exercise (Which is done by shelling out to the os, and opening an exercism url).

This url is currently not linked to the exercise where you pick open (it needs a uuid)

We are currently exec'ing "open ", however open is osx specific whereas I think it's "run" for windows, and not sure for linux

Create ExercismGenerator

This tool will have the following responsibilities:

  • Run all the tests of the reference solutions
  • Generate Tonel files of the passing tests
  • Place the Generated Tonel files in the exercise directory

The generated files are the tests cases that students will engineer solutions for. They are to be downloaded from Exercism.io and introduced into a Pharo image ready to run.

Ask any questions you need for information, or to clarify the scope of this tool.

Discussion - initial impressions

Just installed the Pharo client for the first time and thought it would be good to record my initial impressions.

I did this...

  1. Downloaded Pharo Windows Standalone... http://files.pharo.org/platform/Pharo6.1-win.zip
  2. Updated Iceberg... https://github.com/pharo-vcs/iceberg#update-iceberg
  3. Installed Exercism... https://github.com/exercism/pharo/blob/master/docs/INSTALLATION.md
    except skipped running "ExercismManager welcome"

System Browser shows...
a01-post-load

and after now evaluating ExercismManager welcome, System Browser shows...
a02-post-welcome

Great idea, but the downside of relocating a class out of the ExercismTools package is:

  • ExercismTools package becomes dirty
  • running it a second time (because someone will try - at least I'm looking at myself) shows an error message "package already exists" and opens a debugger "#moveClass:toTag: was sent to nil"

Instead of delivering a Welcome class in ExercismTools, we can create it programatically.
Also, we don't need the user to explicitly run ``````ExercismManager welcome```.
It can be done by the class initialization when ExercismManager class is first loaded.

Handle generator shell output better

The exercism generator shells out to configlet to generate readme files but currently doesn’t handle the output particularly well, particularly if there is a failure (like not installed)

Submitting exercises requires metadata

Our fix to #32 may have an effect on this one.

I tried going through the exercise submission process on macOS as a user so I could get an idea for what needed to be done for using http instead of OSProcess to solve our Windows issues.

I made my solution to HelloWorld, selected submit from the UI and got the following error: Error: Unable to submit solution, CLI reported #('' 'Error: not in workspace')

exercism troubleshoot at the command line shows that my workspace is at /Users/samuelwilson/Exercism while my Pharo vm is running from /Users/samuelwilson/Exercism/pharo in accorance to our installation instructions.

The fix to this seems simple: the command for the CLI which is assembled in ExercismManager>>#submitToExercism: just needs to have a file path that starts from the Exercism workplace.

However we have an additional issue.

Just to be sure I tried exercism submit pharo/hello-world/.pharo/HelloWorld.class.st at the command line from my workspace directory and got another error:

The exercise you are submitting doesn't have the necessary metadata.
    Please see https://exercism.io/cli-v1-to-v2 for instructions on how to fix it.

My CLI is version 3.0.9, the latest at this time. I tried downloading the HelloWorld exercise using the CLI instead of our built in Pharo solution, then copied a Tonel file with the solution into the pharo/hello-world/.pharo directory. I used the command line to submit from there and it worked that time.

The missing meta data might be the .solution.json file in the root of the pharo/hello-world directory. This along with README.md and HelloWorldTest.class.st are the files that are downloaded by the CLI.

Our approach of bringing the exercise straight into the image when downloading means these files were not downloaded, and it seems the .solution.json is required meta data. This might be a exercism v1 vs v2 difference that we missed.

Remove obsolete version tracking assertions in exercises

Some tracks have added assertions to the exercise test suites that ensure that the solution has a hard-coded version in it.
In the old version of the site, this was useful, as it let commenters see what version of the test suite the code had been written against, and they wouldn't accidentally tell people that their code was wrong, when really the world had just moved on since it was submitted.

If this track does not have any assertions that track versions in the exercise tests, please close this issue.

If this track does have this bookkeeping code, then please remove it from all the exercises.

See exercism/exercism#4266 for the full explanation of this change.

Get approved logo to appear on site

We have approval from the Pharo board to use the logo in /img (icon.png) - having checked it into our project it isn't appearing.

@kytrinyx you seemed to infer that you can do something to get this aspect live? Is there anything we can do to make it so (are there any special size requirements or config we need to add)?

Do user testing to establish Pharo7 compatablility

Pharo7 is released now and I think it is worth our time targeting it for our development. It should help simplify some of our development environment setup by having features like Tonel by default and using the latest version of Iceberg.

What I want to do is use our exercism tools like a user and see what breaks through the whole process for each OS. It's also worth checking our development environment setup as some steps may now be redundant.

I'm going to get started on some user testing on Windows10 first.

Upload Smalltalk solution to Exercism

User Story

As a user I want to:

  • Upload my solution to a exercise using the Exercism command line client
  • See my solution on the Exercism webpage for the solved exercise

Summary

For additional background information and examples, see this comment on issue #1.

This is one of the major challenges this language track faces on the road to launch. The code for a solution has to be extracted from a Smalltalk image and placed in a text file ready to be uploaded to Exercism. Once on Exercism it must be displayed for ease of readability without any extra machine readable artifacts or metadata. To allow for the solution to be downloaded and added to a Smalltalk image, it is highly desirable that the original file of extracted code be kept.

Possible Solution

At the moment it is looking like the solution will follow this approximate path:

  1. File out the solution code from the Smalltalk image (already a built in feature)
  2. Upload the solution text file to Exercism using the existing command line tool
  3. Make two copies of the solution file
  4. Retain one copy as an unaltered original (this can be filed back into a Smalltalk image once downloaded)
  5. Strip machine readable artifacts and meta data from the second file leaving only source code
  6. Display the source code on Exercism as the solution to the exercise

Note this is a possible solution, not the only solution.

Alternative Solutions

Pharo's native Git client, Iceberg, can also be used to extract text files, as git is used for versioning plain text files. Managing a git repository, even locally, would require more steps than filing out a file. My own personal experience with Iceberg has been painful, however it is used for development of Pharo so there are likely people who know how to get the best out of it.
Tonel is a new human readable file format for Smalltalk code, for better integration with version control software than the current Filetree format. Several Pharo community members have pointed me toward Tonel as a possible solution.

Todo

  • Create a solution for striping meta data out of a solution file before it is displayed on Exercism
  • Investigate how to integrate these steps into Exercisms existing tool chain
  • Investigate if configuration of the file out location can be done as a first time installation step of Pharo
  • Explore Tonel as an alternative human readable format
  • Find out how to set Pharo's default file out location to the $HOME/exercisim/pharo/<exercise> directory

Write first few exercises

We need a few exercises to get this language track started.

I haven't seen any activity in this repo for a few days. I thought I would get things moving by making some of the first few exercises, an also make sure I have the repo structure correct according to this discussion.

First pull request to follow soon. After that we can have some discussion to make sure the structure of the repo is on the right track.

Todo

  • HelloWorld exercise
  • TwoFer exercise

split tools out of exercises repo

I'm having a hard time working with tools and exercises mixed in one repo.
Here is the state of the system immediately after loading just the ExercismTools package, just prior to creating the "Exercism" package. I see..

  • "Repositories" window shows the repo is "Up to date"
  • "Working copy of pharo" window shows "Exercism"" is unloaded.
  • "Commit" windows is empty

a14-before-adding-exercism-package

After "Add package..." > "Exercism" I now see...

  • "Repositories" window shows the repo has "Uncommitted changes"
  • "Working copy of pharo" window shows "Exercism" has "Uncommitted changes".
  • "Commit" windows is full of changes I've had nothing to do with. This is annoying me when reviewing a change I made to ExercismTools.

a15-after-adding-exercism-package

My other concern is that its terribly easy for a curious student (of which I expect many) to load the "Exercism" package and get all the answers. I think this would really discourage students from working through the course.

I propose we split ExercismTools package out to https://github.com/exercism/exercism-pharo-tooling.
This will...

  • Avoid erroneous changes showing during tool development.
  • Avoid handing all solutions to students
  • Avoid conflict with the "pharo" repo preconfigured in Pharo 7 ==> simpler loading by students.

Leave Exercism and ExercismDev here.

  • The conflict of the "pharo" repo preconfigured in Pharo 7 is less of an issue since students don't need to deal with it, and more experienced Pharoers can easily drop the preconfigured one.

install notes - local copy of Exercism website

Having a locally installed Exercism website may be useful for us to nut out directly submitting from Pharo, but I've had a few difficulties with that. Opened this issue as a place to keep notes, away from other issues.

TL;DR... Installing Exercise website on Ubuntu under Windows Subsystem For Linux
may be blocked by microsoft/WSL#3100 "socketpair() syscall ignores non-blocking request (SOCK_NONBLOCK, O_NONBLOCK) "

I didn't keep an exact log as I went, but the following is pieced together from bash history...

System platform

$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.5 LTS"

$ uname -a
Linux BENGINEER 4.4.0-17134-Microsoft #137-Microsoft Thu Jun 14 18:46:00 PST 2018 x86_64 x86_64 x86_64 GNU/Linux

Updated system and installed required system packages

$ sudo apt-get update && sudo apt-get upgrade

$ sudo apt-get install yarn mysql-server mysql-client libmysqlclient-dev cmake

$ yarn --version
1.9.4

$ mysql --version
mysql Ver 14.14 Distrib 5.7.23, for Linux (x86_64) using EditLine wrapper

$ cmake --version
cmake version 3.5.1

Installed Ruby via Ruby Version Manager per http://rvm.io/

$ gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB

$ \curl -sSL https://get.rvm.io | bash -s stable

$ rvm --version
rvm 1.29.4 (latest) by Michal Papis, Piotr Kuczynski, Wayne E. Seguin [https://rvm.io]

$ rvm use 2.4 --default
Using /home/ben/.rvm/gems/ruby-2.4.4

$ ruby --version
ruby 2.4.4p296 (2018-03-28 revision 63013) [x86_64-linux]

$ gem install bundler

$ bundler --version
Bundler version 1.16.4

Configured database

$ sudo /etc/init.d/mysql start
$ mysql -u root -p

    CREATE USER 'exercism_reboot'@'localhost' IDENTIFIED BY 'exercism_reboot';
    CREATE DATABASE exercism_reboot_test;
    CREATE DATABASE exercism_reboot_development;
    ALTER DATABASE exercism_reboot_test        CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
    ALTER DATABASE exercism_reboot_development CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
    GRANT ALL PRIVILEGES ON exercism_reboot_test.*        TO 'exercism_reboot'@'localhost';
    GRANT ALL PRIVILEGES ON exercism_reboot_development.* TO 'exercism_reboot'@'localhost';

Cloned website and install bundle

$ mkdir -p Repos/Exercism && cd Repos/Exercism

$ git clone [email protected]:exercism/website.git

$ cd website

$ echo "myhost" > server_identity

$ bundle install

$ bundle exec rake exercism:setup

$ bundle exec rails server

In web browser, opened http://lvh:3000 and up popped Exercism web site (yay! the crowd cheered!),
but its empty of tracks (augh... the crowd was disappointed...)

Poke around blindly

At the risk of breaking things (since I haven't used ruby/rails before)...

$ bundle exec rake -T # list of available tasks

$ bundle exec rake db:drop
Dropped database 'exercism_reboot_development'
Dropped database 'exercism_reboot_test'

$ bundle exec rake db:create
Created database 'exercism_reboot_development'
Created database 'exercism_reboot_test'

$ bundle exec rake --trace exercism:setup
All the create_table() and add_foreign_key() succeeded. Here is the log carrying on from the last one...
-- add_foreign_key("user_tracks", "users")
-> 0.1765s
** Invoke db:seed (first_time)
** Execute db:seed
** Invoke db:abort_if_pending_migrations (first_time)
** Invoke db:load_config
** Execute db:abort_if_pending_migrations
rake aborted!
IO::EINPROGRESSWaitWritable: Operation now in progress - connect(2) would block

/home/ben/.rvm/rubies/ruby-2.4.4/lib/ruby/2.4.0/socket.rb:1198:in __connect_nonblock' /home/ben/.rvm/rubies/ruby-2.4.4/lib/ruby/2.4.0/socket.rb:1198:in connect_nonblock'
/home/ben/.rvm/gems/ruby-2.4.4/gems/redis-4.0.1/lib/redis/connection/ruby.rb:187:in rescue in connect_addrinfo' /home/ben/.rvm/gems/ruby-2.4.4/gems/redis-4.0.1/lib/redis/connection/ruby.rb:179:in connect_addrinfo'

P.S. I wonder what is the best way for wipe the slate clean for another try.

Add installation guide for Windows users

Our current installation guide looks like it will work just fine on macOS and Linux, but Windows naturally doesn't have a Bash shell or curl.

The simplest thing to do might be just the traditional Windows convention of download from the website and install yourself, then the usual double click on the icon. Copy, paste, and evaluate the code in the playground for Metacello to get the repo from git.

Probably a lot simpler than asking beginners to install a shell or the Windows Subsystem for Linux.

Improve .gitIgnore for multi lang development

As Pharo doesn't have full git support yet - many contributors will use an external VCS tool like Idea or VCS - so improve the .gitIgnore so we don't end up with extra junk in the repo

Testing macOS from scratch, Error: This URL was not recognised

With the new way of fetching and submitting via HTTP instead of OSProcess, I did a user test on macOS (Mojave 10.14) following our guide as a first time user might.

When trying to fetch hello-world I got the error 'This URL was not recognised'

The error was thrown in ExercismDownload>>#getSolutionData:

getSolutionData
	| responseString response |
	httpclient 
		path: self path, '/latest';
		queryAt: 'track_id' put: track;
		queryAt: 'exercise_id' put: exercise.
		
	responseString := httpclient get.
	(httpclient response code = 401) ifTrue: [ (ExUnauthorized badToken: ApiToken) signal ].
	
	response := (STON fromString: responseString).
	response at: 'error' ifPresent: [ :error | self error: (error at: 'message') ]. "Error thrown here"
	solution := response at: 'solution'.
	ExercismManager solutionData at: exercise put: solution.

I inspected the ExercismDownload httpclient to see what the URL was:

"a ZnClient"
self request uri "https://api.exercism.io:443/v1/solutions/latest/latest?track_id=pharo&exercise_id=hello-world"

A recent test on Windows 10 did not have this same problem. I'm not sure if the problem is with our tools or if the URL has been changed and we are using the wrong one.

TDD doesn't work so well with a missing class

When we use TonelReader to load in code - missing classes are mapped to null - this means that TDD in the debugger isn't so hot - the debugger doesn't offer to create that class for you - you have to save the method in the debugger to cause it to spot the null class and offer to create it. You then can't press the create button for the missing method - you have to press proceed to get it to re-eval.

Its all a bit of a mess - and something Pharo should be better at.

Do we have to fix the debugger (might not be too hard)

Fix getting started instructions for pharo

Some exercise README templates contain links to pages which no longer exist in v2 Exercism.

For example, C++'s README template had a link to /languages/cpp for instructions on running tests. The correct URLs to use can be found in the 'Still stuck?' sidebar of exercise pages on the live site. You'll need to join the track and go to the first exercise to see them.

Please update any broken links in the 'config/exercise_readme.go.tmpl' file, and run 'configlet generate .' to generate new exercise READMEs with the fixes.

Instructions for generating READMEs with configlet can be found at:
https://github.com/exercism/docs/blob/master/language-tracks/exercises/anatomy/readmes.md#generating-a-readme

Instructions for installing configlet can be found at:
https://github.com/exercism/docs/blob/bc29a1884da6c401de6f3f211d03aabe53894318/language-tracks/launch/first-exercise.md#the-configlet-tool

Tracking exercism/exercism#4102

Rework config.json Test and domain class lint checking

The exercism config.json has entries to match test classes, solution classes and ignore classes.

It defaults to regex to match [Tt]est for tests and [Ex]xample for domain classes. The future generator could write files out to fit this, but @samWson pointed out it feels weird to write tests that instantiate and DomainExample class (e.g. HelloWorldExample new) - we should be able to just write a better regex for such a simple lint check.

Unable to retrieve hello-world via exercism client

Now we have been restored to "beta" mode in V2 exercism, when you use the command line client you get an error 'solution not found' even though the configlet linter is fine locally and the config.json looks ok?

e.g.

$exercism download -t pharo -e hello-world
Error: Solution not found

@kytrinyx are we missing some extra config? The exercism version is: exercism version 3.0.6

Close old branches

We currently have no open pull requests but 18 open branches, many already merged as seen at... https://github.com/exercism/pharo/network and https://github.com/exercism/pharo/branches

Propose deleting the following branches...

  • improved-installation-readme - merged. remove.
  • environment-fixes - merged. remove.
  • tools-code-cleanup - merged. remove.
  • regenerate-base-examples - merged. remove.
  • sum-of-multiples - merged. remove.
  • acronym-exercises - merged. remove.
  • issue-45 - merged. remove.
  • http-exercise-retrieval - merged. remove.
  • improved-dev-readme - merged. remove.
  • http-submit-exercises - merged. remove.
  • apikey-better-error-handling - merged. remove.
  • ExternalWebBrowser-support branch list says merged although not reflected in the chart. I've verified all additions here are already in "master". Remove!

Review of remaining...

  • fix-getting-started (Tim) - looks merged in the network chart, but not-merged in repo list. @macta could you advise?
  • intro-exercise-description-improvements & intro-exercise-description-improvements2 (Tim)
    Showing 12 changed files, 214 additions, 32 deletions. Too much for an unfamiliar quick review.
    @macta could you advise. Seems related to closed issues #67 and #69. From the closing comment "Should have branched from master to exclude leap" I guess these branches should be thrown away??

Review bencoman repo...

  • patch-1 (Ben) - verified this change is in "master". Remove!
  • welcome-setup (Ben) - Tim didn't like this, but leave for the moment as a reference.
  • issue-10 (Samuel) - defines the TwoFer class - looks pre-Tonel and a different path. @samWson please advise.
  • issue-10-tonel (Ben) - defines the TwoFer class in Tonel format. This is mine and I've no clue why its here. Perhaps I was experimenting during the transition to Tonel. Code already exists in "master". Remove!
  • risk-example - Demonstrates risk when user exercise sources mixed in with tool sources. Keep for now.

Review jackhughesweb repo...

  • auto-approve (Jack) - The impact of this is not clear. @jackhughesweb could you please advise?

Create an Exercise Test generator

I noticed that it can be a bit repetitive translating the problem specifications into tests - as they are in Json - its pretty trivial to generate the test class and methods for you based on the spec.

I think its better to generate actual methods as it makes it much easier to debug in the environment if you have a real method to restart (vs. dynamically doing asserts?)

This does hightlight some inconsistencies in the test specs - with regards to method naming, so manually tweaking it after generation is probably still handy.

Sort out exercism baseline versioning

To ensure users don’t run afoul of the package cache - introduce proper baseline versioning (and git tag) and update the readme with the version number for launch

Get a suitable logo for the Pharo language track

We need a logo to represent Pharo on the Exercism web site. There is a quick guide on this here.

We need the following:

  • Permission to use an offical Pharo logo
  • Attribution rights of the logo
  • A link to an example of the logo

With that in hand the next thing to do is to open up an issue on exercism/website-icons with the above information.

Implement continuous integration

Implement a track test suite that can run both locally and on Travis CI. The track test suite should verify that each exercise makes sense, by running the exercise tests against the example solution.

Definition of terms

  • exercise test suite: the test suite that is delivered to Exercism users as part of an Exercism exercise
  • track test suite: the test suite that helps ensure that all of the exercise test suites in a language track are solvable

Background

When implementing an exercise test suite, we want to provide a good user experience for the people writing a solution to the exercise. People should not be confused or overwhelmed.

In most Exercism language tracks, we simulate Test-Driven Development (TDD) by implementing the tests in order of increasing complexity. We try to ensure that each test either

  • helps triangulate a solution to be more generic, or
  • requires new functionality incrementally.

Many test frameworks will randomize the order of the tests when running them. This is an excellent practice, which helps ensure that subsequent tests are not dependent on side effects from earlier tests. However, in order to simulate TDD we want tests to run in the order that they are defined, and we want them to fail fast, that is to say, as soon as the test suite encounters a failure, we want the execution to stop. This ensures that the person implementing the solution sees only one error or failure message at a time, unless they make a change which causes prior tests to fail.

This is the same experience that they would get if they were implementing each new test themselves.

Most testing frameworks do not have the necessary configuration options to get this behavior directly, but they often do have a way of marking tests as skipped or pending. The mechanism for this will vary from language to language and from test framework to test framework.

Whatever the mechanism—functions, methods, annotations, directives, commenting out tests, or some other approach—these are changes made directly to the test file. The person solving the exercise will need to edit the test file in order to "activate" each subsequent test.

Any tests that are marked as skipped will not be verified by the track test suite unless special care is taken.

Additionally, in some programming languages, the name of the file containing the solution is hard-coded in the test suite, and the example solution is not named in the way that we expect people to name their files.

We will need to temporarily (and programmatically) edit the exercise test suites to ensure that all of their tests are active. We may also need to rename the example solution file(s) in order for the exercise test suite to run against it.

Avoiding accidental git check-ins

It's important that if we rewrite files in any way during a test run, that these changes do not accidentally get checked in to the git repository.

Therefore, many language tracks write the track test suite in such a way that it copies the exercise to a temporary location outside of the git repository before editing or rewriting the exercise files during a test run.

Working around long-running track test suites

Usually as people are developing the track, they're focused on a single exercise. If running the entire track test suite against all of the exercises takes a long time, it is often worth making it possible to verify just one exercise at a time.

Example build file

The PHP track has created a Makefile. The Ruby track uses Rake, which is a tool written in Ruby, allowing the track maintainers to write custom code in the language of the track to customize the build with a Rakefile.

Implement the Core Exercises

When you complete hello-world, you are presented with a progress tracker for core exercises.

We need to implement these for Pharo.

However @kytrinyx, how do we know what are the core exercises? Is this specified somewhere - the exercism/problem-specifications repo just seems to list them all, but I can't see any tagging?

Exercise generator should also write out to config.json

When generating the exercises, the generator could/should also generate the config.json so that exercises are properly linked to exercism and it doesn't require an extra manual step to remember.

It actually would be useful if the exercise package was annotated (possibly via the testcase) with the uuid of the exercise and other meta information needed to create a config.json entry.

The uuid, could also be handy to allow pharo to open the correct web page for an exercise (its based on uuid)

Fix code snippet in README

There is something odd about how the code snippets are being rendered in the README. However looking at the markdown code it appears to be fine.

badly-rendered-markdown

When I have a look at the same file in MacDown on my computer, the code snippets are rendered and displayed correctly. Maybe there is some small quirk with how Github renders markdown?

Consider consistency for the exercises

  • Is there a style guide for Pharo?
  • Are these styles encouraged or enforced?
  • Are there any conventions that we should adopt on this track for the sake of consistency?
  • Can we enforce these?
  • Is there a linter? Are there many? Should we use one?
  • When you add a linter, edit the pull request template [link]
  • Update the pull request template with checks that are appropriate for this track
  • Is there a common convention for filenames? If not, what should our convention be?

Note that this is about the exercises (the test suites and code examples), not people's solutions.

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.