Skip to content

Commit

Permalink
Protocol change to https style (And some markdown style updates) (#636)
Browse files Browse the repository at this point in the history
* Style consistency

- Blank line after heading
- EOL at last line
- Trailing whitespace reserved for semantic use

* Using http secure protocol where we can
  • Loading branch information
kotp authored Jun 28, 2024
1 parent 1507acb commit 4afa33f
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 43 deletions.
70 changes: 40 additions & 30 deletions docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
# Contributing guidelines
If you want to participate on Pharo track development, you should follow instructions below that will help you to start.

If you want to participate on Pharo track development, you should follow instructions below that will help you to start.

We are keen to improve this track and show developers a different way of thinking about coding! :tada:

Please read how to [get involved in an Exercism track](https://github.com/exercism/docs/tree/master/contributing-to-language-tracks) and also be sure to read the [Exercism Code of Conduct](https://exercism.io/code-of-conduct).

We welcome pull requests of all kinds. No contribution is too small, particularly those that provide fixes and improvements to existing exercises. Note that this track's exercises must conform to the [Exercism-wide standards](https://github.com/exercism/docs/tree/master/language-tracks/exercises), but if you're unsure about how to make a change, then open a GitHub issue, and we'll discuss it.

>__Note__: Exercism organization has decided to [pause Exercism wider community contributions](https://exercism.org/blog/freeing-our-maintainers). Pharo track is opted-out from this policy, since our community is rather small (In other words: any Pharo track contributor can still create issues and submit PRs).
>__Note__: Exercism organization has decided to [pause Exercism wider community contributions](https://exercism.org/blog/freeing-our-maintainers). Pharo track is opted-out from this policy, since our community is rather small (In other words: any Pharo track contributor can still create issues and submit PRs).
## Knowledge prerequisites

Expand All @@ -16,17 +17,20 @@ It is expected that you are already [familiar](./docs/RESOURCES.md) with develop
---

## Development environment setup
To begin, you need to ensure that you have a complete Exercism development environment and have following artefacts installed:

To begin, you need to ensure that you have a complete Exercism development environment and have following artefacts installed:

### __Pharo image and IDE__
You need to have a Pharo development environment (running Pharo image - IDE) for creating the actual coding examples.

You need to have a Pharo development environment (running Pharo image - IDE) for creating the actual coding examples.

1. Use [PharoLauncher](https://pharo.org/download) to create a fresh 10.0 (stable) development image from `Official distributions` category, and launch it (you can also use [zerconf](https://get.pharo.org/) if you are familiar with it).
2. Launch your image to test everything runs ok.

> __Note__: If you have any TIMEOUT problems refer to the [user installation instructions](./docs/INSTALLATION.md).
### __Setup of git repositories__

1. If you haven't done previously, fork `https://exercism/pharo-smalltalk` on Github.
2. To clone your fork, evaluate following command in Playground of running Pharo image:
```
Expand All @@ -35,52 +39,56 @@ Metacello new
repository: 'github://exercism/pharo-smalltalk:main/releases/latest';
load: 'dev'
```
This will effectively clone git repository of Pharo track and load Pharo track source code into Pharo image - its development baseline. Local folder with cloned repository will be located in (depending on your Iceberg preferences): `<path-to-Pharo-image>/pharo-local/iceberg/<your-id/pharo-smalltalk`.
This will effectively clone git repository of Pharo track and load Pharo track source code into Pharo image - its development baseline. Local folder with cloned repository will be located in (depending on your Iceberg preferences): `<path-to-Pharo-image>/pharo-local/iceberg/<your-id/pharo-smalltalk`.
> __Note__: Pharo image sources are synchronized and serialized in `*.st` files locaded in `src` sub-folder of aforementioned directory.
2. Other way to do the same is to clone your fork via CLI: `git clone https://github.com/<your id>/pharo-smalltalk` as a GitHub project and specify `<your id>` as the owner name, `pharo-smalltalk` as the project name.
2. Other way to do the same is to clone your fork via CLI: `git clone https://github.com/<your id>/pharo-smalltalk` as a GitHub project and specify `<your id>` as the owner name, `pharo-smalltalk` as the project name.
Then Install the Metacello baseline `dev` (not the default) in Iceberg using the Metacello context menu of running Pharo image. (e.g. right click on the "pharo-smalltalk" project you just cloned, and select the second option in the Metacello menu, and type `dev`)

3. After loading project to Pharo image, don't forget to __Save image__ changes (menu item Pharo -> Save).

__Optional repositories__
__Optional repositories__
1. Alernatively you can `git clone https://github.com/exercism/pharo-smalltalk` as a staging repository to which you will generate exercises and assets to check-in (separately from coding in Pharo). Note that changes generated by Configlet tool in this repository will need to be copied into your local fork repository. Suggestion is to use something like `~/development/exercism/pharo-staging` to avoid any confusion (note: it can reside anywhere). This repository is not needed, you can still generate configlet changes directly in your forked repo (That is synced with your Pharo image), if you are sure, which changes to include in commit.
2. You can also clone Exercism [problem specifications](https://github.com/exercism/problem-specifications), in case you want to work on Practise exercises from scratch. Put it also in a subdirectory of the exercism workspace configured below (this repo is used to generate exercise readme.md files, and is a reference to the suggested tests).

### __Note about used repository branches__

The `main` branch is the primary development branch to which is everything merged. If you work on some change in code, create feature branch originated from main and commit your changes there. Once completed, issue PR on github to be merged to `main` of base rerpository (Exercism/pharo-smalltalk). This branch used to be called `master` - __now deprecated__.
The `main` branch is the primary development branch to which is everything merged. If you work on some change in code, create feature branch originated from main and commit your changes there. Once completed, issue PR on github to be merged to `main` of base rerpository (Exercism/pharo-smalltalk). This branch used to be called `master` - __now deprecated__.

### __Setup of Exercism CLI tools__
These tools are needed to interact with Exercism project:

These tools are needed to interact with Exercism project:
1. the [exercism command line interface](https://exercism.io/cli-walkthrough) and configured it to directory with Exercism exercises development called workspace (e.g. `exercism configure -w ~/development/exercism`). This could be either path to your local fork repository or (optional) staging repository.
2. the Exercism [configlet](https://github.com/exercism/configlet#usage) linter/generator for generating exercise metadata and running validations. To install Configlet follow instructions in [Use in your track](https://github.com/exercism/configlet#use-in-your-track) paragraph (see bin/fetch-configlet).

---

## Working on Exercism exercises

Exercism organization distinguish between Concept exercises (explaining PL theory) and Practise exercises. Paragraphs below focus just on Practise exercise contribution so far.

### __Overview__
Steps to complete exercise:
1a. Create Practise exercise from scratch (from problem specifications).
1b. Work on solution of existing Practise exercise.
2a. Generate serialized source files of exercise solution to directory and generate exercise metadata.
2b. Adjust project baseline to include newly completed exercise as part of project.
3. Commit changes to your repository fork and publish changes by issing PR.


Steps to complete exercise:
1a. Create Practise exercise from scratch (from problem specifications).
1b. Work on solution of existing Practise exercise.
2a. Generate serialized source files of exercise solution to directory and generate exercise metadata.
2b. Adjust project baseline to include newly completed exercise as part of project.
3. Commit changes to your repository fork and publish changes by issing PR.

![Workflow to complete Practise exercise](/docs/images/overview-exercism-pharo-contribution.svg)

### __1. Create new Practise exercise__

__From problem repository__
- If you want to start completely new Practise exercise (step 1a.), you can use problem specification repository and generate test class for given exercise by running:
`ExercismExerciseGenerator generateFrom: <path-to-problem-specifications/exercises>` - this will generate test classes for all exercises in problem specifications repository in `ExerciseWIP` package.
- If you want to start completely new Practise exercise (step 1a.), you can use problem specification repository and generate test class for given exercise by running:
`ExercismExerciseGenerator generateFrom: <path-to-problem-specifications/exercises>` - this will generate test classes for all exercises in problem specifications repository in `ExerciseWIP` package.
> __Note__: You can use menu item in Pharo image for achieving same (World menu -> Exercism -> Generate test cases).
- More specifically, you can generate test class for specific exercise by: `ExercismExerciseGenerator generateExerciseFrom: '<path-to-problem-specifications/exercises/slug-name>' asFileReference`.
Result of previous statement will be new `<SlugNameTest>` (a subclass of ExercismTest) test class with generated test methods in `ExerciseWIP` package.

__From scratch__
__From scratch__
If you have an interesting idea, refer to the documentation about adding new exercises.

There is an example of a user defined exercise in the project, see: `DieTest`. By overriding the method customData, the generator will create the relevant files for you.
Expand Down Expand Up @@ -112,10 +120,10 @@ While there many ways to help, by far the easiest and most useful contribution i

* Update the exercise meta data on the class side of the exercise by overriding the #exercise method and filling in a difficulty, topics etc. You should also fill in some Hint text in the Test comment tab (at the bottom - by replacing the text TBD)

* Update the package of the chosen example to `Exercise@<ExerciseName>` (i.e. move it out of the WIP package) - step 1b.
* Update the package of the chosen example to `Exercise@<ExerciseName>` (i.e. move it out of the WIP package) - step 1b.
* Create a new branch in Iceberg with the name of the exercise you chose (you can use the Iceberg tool for this, and enter your issue number from above).
* Before submitting your pull request, Run all the tests for the Pharo exercises and ensure they __all pass__.


### Testing

Expand All @@ -130,7 +138,7 @@ To test an exercise run it from the built-in test runner by clicking on the test
AllExercismTests suite run. "all exercises"
```
> __Note:__ If you want to define your own (non-generated) test case, you can put it to `extra` protocol of test class.
> __Note:__ If you want to define your own (non-generated) test case, you can put it to `extra` protocol of test class.
For consistency, we use the test parameter order: `self assert: actual equals: expected` it test method.


Expand All @@ -140,7 +148,8 @@ are using that image to test subsequent development baselines - you may need to


### __3. Publishing A Completed Exercise__
Now when you're done with solution and commits to you local feature branch, you should complete these steps:

Now when you're done with solution and commits to you local feature branch, you should complete these steps:
Step 2a: __Generate source code__ files for solution and test class by running either:
- `ExercismGenerator generate` -> this will generate all souce files of all exercises. It will run `generate` command of configlet and also re-generates `config.json` that lists all valid exercises. (Or in World menu choose: "Exercism" -> "Regenerate meta data")

Expand All @@ -151,21 +160,22 @@ Or:
- update `config.json` manually (see `ExercismGenerator>>generate` for details)
- `configlet sync --docs --filepaths --metadata -uy -e <slug-name>` tu update all metadata for specific exercise. See details: [Using sync when adding a new exercise](https://github.com/exercism/configlet#using-sync-when-adding-a-new-exercise-to-a-track)
Step 2b: Update Pharo-smalltalk project baseline by adding exercise name in list of `BaselineOfExercism>>exercisePackageNames` method. This will ensure your exercise to be loaded, when project is loaded including new exercise by Metacello command.
Step 2b: Update Pharo-smalltalk project baseline by adding exercise name in list of `BaselineOfExercism>>exercisePackageNames` method. This will ensure your exercise to be loaded, when project is loaded including new exercise by Metacello command.

Step 3: Before creating PR, you should check if Exercism artefacts are correct by running CLI command:
`bin/configlet lint`. If everyrting is ok. PR can be created.
Step 3: Before creating PR, you should check if Exercism artefacts are correct by running CLI command:
`bin/configlet lint`. If everyrting is ok. PR can be created.

__Submitting a Pull Request__
__Submitting a Pull Request__
Pull requests should be focused on a single exercise, issue, or conceptually cohesive change. Refer to Exercism's [pull request guidelines](https://github.com/exercism/docs/tree/main/building/github#guides) for more detail.


* Now get your solution reviewed by pushing your branch to your fork and then creating a PR on exercism/pharo-Smalltalk. It is important to [enable maintainer edits](https://help.github.com/en/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork), so we can collaborate with you in your branch
* follow your PR and answer any ensuing questions
* finally submit any adjustments and a maintainer will merge your Pull request to appear final solution on the site.

---
---
## Additional information for maintainers

### Coding Style

The code in this repository should follow [Pharo with style](https://github.com/SquareBracketAssociates/Booklet-PharoWithStyle) conventions wherever possible. You can also refer to the more generic [Smalltalk with style](http://sdmeta.gforge.inria.fr/FreeBooks/WithStyle/SmalltalkWithStyle.pdf) as well.
Expand All @@ -180,4 +190,4 @@ If you plan to make significant or breaking changes, please open an issue so we

Thanks to the Pharo team for all their dedication in building a modern open source Smalltalk.

![Pharo](http://pharo.org/web/files/pharo.png)
![Pharo](https://pharo.org/web/files/pharo.png)
16 changes: 9 additions & 7 deletions docs/LEARNING.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,24 @@
As Smalltalk is widely used, there is rich choice of reading material.

## Starting Out
* [Pharo Main Site](http://pharo.org/documentation):

* [Pharo Main Site](https://pharo.org/documentation):
has a wealth of articles and help
* [Pharo Syntax Cheatsheet](http://files.pharo.org/media/pharoCheatSheet.pdf):
* [Pharo Syntax Cheatsheet](https://files.pharo.org/media/pharoCheatSheet.pdf):
it fits on a postcard
* [I Can Read C but not Smalltalk](http://www.eli.sdsu.edu/courses/spring01/cs635/readingSmalltalk.pdf): several easy steps to understanding Smalltalk
* [I Can Read C but not Smalltalk](https://www.eli.sdsu.edu/courses/spring01/cs635/readingSmalltalk.pdf): several easy steps to understanding Smalltalk
* [Pharo By Example (9.0)](https://books.pharo.org/pharo-by-example9/):
a full pdf book with step by step examples
* [Learning OOP and TDD in Pharo](http://books.pharo.org/learning-oop/):
* [Learning OOP and TDD in Pharo](https://books.pharo.org/learning-oop/):
introduces more programming techniques and concepts
* [Discord](https://discord.gg/QewZMZa) has an
active online Pharo discussions forum (use the invite link at the top of the [Community Page](http://pharo.org/community))
* [Pharo Mooc](http://mooc.pharo.org/):
active online Pharo discussions forum (use the invite link at the top of the [Community Page](https://pharo.org/community))
* [Pharo Mooc](https://mooc.pharo.org/):
provides a series of full programming courses and videos

## More Advanced
* [Deep Into Pharo](http://books.pharo.org/deep-into-pharo/):

* [Deep Into Pharo](https://books.pharo.org/deep-into-pharo/):
takes you through more advanced topics like graphics and parsing
* [Pharo with style](https://github.com/SquareBracketAssociates/Booklet-PharoWithStyle):
is the guide for formatting and designing the Pharo way
Expand Down
14 changes: 8 additions & 6 deletions docs/RESOURCES.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@

## Recommended Resources

The following are useful starting points for getting more detailed information about Pharo and its community:

* [Pharo Main Site](http://pharo.org/documentation)
* [Pharo Syntax Cheatsheet](http://files.pharo.org/media/pharoCheatSheet.pdf)
* [Pharo Main Site](https://pharo.org/documentation)
* [Pharo Syntax Cheatsheet](https://files.pharo.org/media/pharoCheatSheet.pdf)

### Community
* [Pharo Community Resources](http://pharo.org/community) (including Discord chat link)
* [Contribute to Pharo](http://pharo.org/contribute)

* [Pharo Community Resources](https://pharo.org/community) (including Discord chat link)
* [Contribute to Pharo](https://pharo.org/contribute)

### Environment

* [Pharo Screencasts](https://www.youtube.com/channel/UCp3mNigANqkesFzdm058bvw)
* [Early History Of Smalltalk](http://worrydream.com/EarlyHistoryOfSmalltalk/)
* [Pharo Git Support (Iceberg)](https://github.com/pharo-vcs/iceberg)
* [Pharo Git Versioning Explained](http://blog.yuriy.tymch.uk/2015/07/pharo-and-github-versioning-revision-2.html)

### Docs

* [Pharo with style](https://github.com/SquareBracketAssociates/Booklet-PharoWithStyle)
* [Smalltalk with style](http://sdmeta.gforge.inria.fr/FreeBooks/WithStyle/SmalltalkWithStyle.pdf)
* [Smalltalk ANSI Standard](http://wiki.squeak.org/squeak/uploads/172/standard_v1_9-indexed.pdf)
* [Smalltalk Grammar](https://gist.github.com/sin3141592/602700)
* [Deep Into Pharo](http://books.pharo.org/deep-into-pharo/)
* [Deep Into Pharo](https://books.pharo.org/deep-into-pharo/)
* [Call Stack Management](https://files.pharo.org/books-pdfs/booklet-CallStack/2018-01-23-CallStack.pdf)

0 comments on commit 4afa33f

Please sign in to comment.