github.com/study-group-99/pilates@v0.2.2/README.md (about)

     1  <p align="center">
     2    <img width="26%" src="https://user-images.githubusercontent.com/22690219/120901102-6aaf9d80-c641-11eb-9fe9-a5953f596bc9.png" />
     3  </p>
     4   
     5  # Ultimate Pilates Engine
     6  A CLI (command line interface) common core tester.
     7  ```
     8  $ pilates
     9  pilates v0.2.1 - Ultimate Pilates Machine
    10  
    11  pilates is an educational devops tool designed to help you along your curriculum.
    12  
    13  Available commands:
    14  
    15     libft   Install and run unit tests, benchmarks, norm check, makefile check & memory leaks checks. 
    16  
    17  Flags:
    18  
    19    -h, --help
    20      	Get help on the 'pilates' command.
    21    -u, --update
    22      	Update Pilates to the latest version.
    23    -v, --version
    24      	Pilates CLI version.
    25  
    26  ```
    27  
    28  ## Contents
    29  
    30  - [Installation](#installation)
    31  	- [Mac](#mac)
    32  	  <!-- - [Homebrew](#homebrew) -->
    33  	- [Linux (+wsl)](#linux)
    34  	  <!-- - [Package](#package)
    35  	    - [deb](#deb)
    36  	    - [rpm](#rpm) -->
    37  	- [Go](#go)
    38  	  - [Install](#go-install)
    39  	  - [Build Source](#build-source)
    40  	<!-- - [Docker](#docker) -->
    41  	- [Script](#script)
    42  - [Usage](#usage)
    43  	- [libft](#libft)
    44  	  - [Init](#init)
    45  	  - [Run](#run)
    46  - [Development](#development)
    47  	- [Contributing](#contributing)
    48  - [Roadmap](#roadmap)
    49  - [Credits](#credits)
    50  
    51  # Installation
    52  
    53  ## Mac
    54  
    55  **Manual**
    56  
    57  * Download the latest stable (or beta) [release](https://github.com/study-group-99/pilates/releases).
    58  
    59  * Move the binary in `/usr/local/bin` (or a custom location).
    60  
    61  _If you opt for custom location you may need to include it in you [Path](https://www.architectryan.com/2012/10/02/add-to-the-path-on-mac-os-x-mountain-lion/#.Uydjga1dXDg)._
    62  
    63   _You may need to restart any open Terminal sessions for the change to take effect._
    64  
    65  ### Homebrew Tap
    66  
    67  [Coming soon.](https://github.com/study-group-99/pilates/discussions/21)
    68  
    69  ## Linux
    70  
    71  **Manual**
    72  
    73  * Download the latest stable (or beta) [release](https://github.com/study-group-99/pilates/releases).
    74  
    75  * Move the binary in `$HOME/.local/bin` (or a custom location).
    76  
    77  **Path**
    78  
    79  You may need to include the directory in your path.
    80  
    81  Open you `~/.bashrc` or `~/.profile` etc amd add the line
    82  
    83  ```PATH="$HOME/.local/bin:$PATH"```
    84  
    85  To load the changes run `source ~/.profile` or `source ~/.bashrc` etc.
    86  
    87  ### deb/rpm Packages
    88  
    89  [Coming soon.](https://github.com/study-group-99/pilates/discussions/21)
    90  
    91  <!-- #### deb -->
    92  
    93  <!-- #### rpm -->
    94  
    95  ## Script
    96  
    97  You can install `pilates` via an `install.sh` script.
    98  
    99  `curl -sfL https://raw.githubusercontent.com/study-group-99/pilates/main/install.sh | sh`
   100  
   101  This will download and install latest stable release. If you feel adventurous you can download the script and run locally pointing to latest beta ie. `sh install.sh pilates-v0.1.0-beta.1`. Please check [releases](https://github.com/study-group-99/pilates/releases) for latest beta version.
   102  
   103  _Path_
   104  
   105  _See relevant path instructions for your platform above._
   106  
   107  <!-- ## Docker -->
   108  
   109  ## Go
   110  
   111  _Note: minimum go version required is 1.6+._
   112  
   113  ### Go Install
   114  
   115  `go install github.com/study-group-99/pilates/cmd/pilates`
   116  
   117  _Remember that you need to have $GOPATH/bin in your path._
   118  
   119  ### Build Source
   120  
   121  * Clone the repo `git clone https://github.com/study-group-99/pilates.git`
   122  
   123  * Change in the `pilates` directory `cd pilates`
   124  
   125  * Build the app `go build ./cmd/pilates`
   126  
   127  # Usage
   128  
   129  ### Help
   130  
   131  To print the help screen of root command run `pilates -h` or `pilates --help`.
   132  
   133  In there you will find information about pilates available subcommands and options (flags).
   134  
   135  Each sub command has a more thorough help section available under the `-h` of the subcommand. For example `pilates libft -h` will return the expanded relevant section of the `libft` subcommand and its options.
   136  
   137  ## libft
   138  
   139  **Dependencies: Cmake, Gcovr, Norminette**
   140  
   141  Pilates needs Cmake for building the unit tests. In addition Gcovr is needed if you you would like to use the -c, --coverage option. We assume Norminette is already installed but if not please do or option -n, --norm will return an err.
   142  
   143  Linux:
   144  
   145  * Debian/Ubuntu `sudo apt-get install cmake gcovr`
   146  * RHEL/Fedora/CentOS/ `sudo yum install cmake gcovr`
   147  
   148  Mac:
   149  
   150  * Via brew `brew install cmake gcovr`
   151  * Manually from https://cmake.org/download/
   152  * `pip install gcovr`
   153  
   154  Norminette:
   155  
   156  * `python3 -m pip install norminette`
   157  
   158  **`new`**
   159  
   160  pilates is using the `google test` framework which is written in C++. Consequently `new` can not be used as argument in any of your C prototypes or tests wont even build.
   161  
   162  To circumvent this issue rename all arguments named `new` to something different in both `libft.h` and the equivalent `ft_*.c` file.
   163  
   164  pilates can do this for you automagically by running `pilates libft init --fix-new`. Behind the scenes pilates will edit your `libft.h` and all `ft_*.c` files necessary, replacing `new` with `neew`.
   165  
   166  ### Init
   167  
   168  Open a terminal and `cd` in you `libft` directory. Run `pilates libft init`. pilates will create a `.gitignore` file if it does not exists, two `CMakeLists` files a pilates directory.
   169  
   170  _If for any reason you would like to re-init you can use the -f, --force option `pilates libft init -f`._
   171  
   172  All tests are `.cpp` files that live inside pilates directory. You are strongly advised to look inside! If you know what you are doing you of-course can edit/comment out/delete or add code.
   173  
   174  Files and directories generated by pilates are all listed in the `.gitignore` so when you submit your project no artifacts will be present.
   175  
   176  ### Run
   177  
   178  The `run` subcommand is intended to be used with one of the bellow options. Trying to run it without one will return an error. To print help run `pilates libft run -h`.
   179  
   180  #### Unit
   181  
   182  `pilates libft run --unit` or `pilates libft run -u` for short. 
   183  The -u, --unit option will run unit tests against your libft files. There is no part one/two, bonus options etc. pilates will test against all `ft_*.c` found on top level directory.
   184  
   185  _Building and running the unit tests will create a new directory `build`._
   186  
   187  ##### Coverage
   188  
   189  You can optionally see the coverage of you code by passing the -c --coverage option.
   190  
   191  #### Makefile
   192  
   193  `pilates libft run -m` the `makefile` option will attempt to build your Makefile checking that all that should exist work.
   194  
   195  #### Norm
   196  
   197  `pilates libft run -n` runs linter checks. It is meant to be used along -r, --report option for wholesomeness.
   198  
   199  #### Report
   200  
   201  `pilates libft run -ur` generates a `report.txt` log file. Report option can not be used alone.
   202  
   203  #### All
   204  
   205  `pilates libft run -a` option -a, --all will turn all other options true. It is the equivalent of `pilates libft run -unmcr`.
   206  
   207  
   208  # Development
   209  
   210  `pilates` is written in `go 1.6+`. Older versions won't work because of the `embed` feature use.
   211  
   212  Go unit tests use all the dependencies needed for end users so the same applies here as well.
   213  
   214  _If the contribution is go code + new feature instead of bug fix, please include at least an example usage unit test._
   215  
   216  ### Branch workflow and commit messages
   217  
   218  We use [gitflow workflow](https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow) so all development is happening in the `dev` branch.
   219  
   220  All commit messages should adhere to [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/).
   221  
   222  ### Feature/bug cycles
   223  
   224  1. Open/assign your self to a ticket in discussions/issues.
   225  
   226  2. Fork/clone the repo, checkout `dev` branch and then branch off to a new branch named after the feature you are implementing/bug fixing, ie. `git checkout -b feat/libft_benchmarks` or `git checkout -b fix/libftmemeoryleaks`.
   227  
   228  3. Push changes and open a pull request against `dev` branch.
   229  
   230  4. The title of the pull requests should be in the form of `feat: feature name (#19)`. #19 is the number of the issue/discussion.
   231  
   232  5. Wait for reviews to finish.
   233  
   234  6. Once all `lgtm` **squash** merge. The message when squashing should look something like `feat: bug name (#19) (#25)` or `fix: feature name (#19) (#25)` with the second (#25) being the pull requests itself.
   235  
   236  _note: org members do not need to fork but outside collaborators do._
   237  
   238  #### Beta
   239  
   240  On successful merge on `dev` branch automation fires a new `beta` release for testing purposes.
   241  
   242  ### Release
   243  
   244  When a pull request against `main` branch is successfully merged automation will make a new release (see `/workflows/release.yml` & `./goreleaser.yml`). If commit messages contain `feat` a minor bump will run `v0.1.0` to `v0.2.0`, if commit messages contain `fix` a patch bump will run ie. `v0.1.0` to `v0.1.1`. If messages contain `breaking` a major bump will run `v0.1.0` to `v1.0.0`.
   245  
   246  ### Local Dev
   247  
   248  When implementing a feature or patch for a bug the two ways to test what you did are 
   249  
   250  1. `go install ./cmd/pilates` which will build a binary inside `go/bin`. You can you use this binary against some test directory.
   251  2. `go test ./... -v` to run through all unit tests.
   252  
   253  #### CI
   254  
   255  ##### Comments
   256  
   257  Regardless the branch contributors can comment/trig certain actions (see `/workflows/comments.yml`).
   258  
   259  `/libft-ci` : Triggers cpp unit tests for libft. Comments back the result once actions is done.
   260  
   261  ##### Pull requests defaults
   262  
   263  * Go tests (see `/workflows/gotests.yml`) run on every pull request made on `dev` and `main` branches.
   264  
   265  * Individual c/cpp tests (see `/workflows/main.yml`) run only on `main`.
   266  
   267  ## Contributing
   268  
   269  All active students and alumni are welcome to contribute.
   270  
   271  _We are especially interested in forming a small "core" team of maintainers._
   272  
   273  * **Code** ~ A good place to start is to check for open [issues](https://github.com/study-group-99/pilates/issues) (bugs) or in [discussions](https://github.com/study-group-99/pilates/discussions/categories/feature-request) for  unassigned feature request tickets. Once you have identified what you would like to contribute to assign yourself and let others know.
   274  
   275  * **Bug reports** ~ Bug reports are **very** welcome. If you spot `pilates` misbehaving do [open an issue](https://github.com/study-group-99/pilates/issues/new) describing the bug, your OS, and pilates version.
   276  
   277  * **Feature requests** ~ If `pilates` does not have the functionality you wish, [open a ticket](https://github.com/study-group-99/pilates/discussions/new) in discussions under `feature request` describing the clearest you can how the new feature should behave and what it accomplishes.
   278  
   279  * **Reviews** ~ If you would like to sharpen your code review skills contact someone that is already in org to send an invitation and start reviewing voluntarily any of the open pull requests.
   280  
   281  # Roadmap
   282  
   283  - [x] Libft
   284  - [ ] ft_printf
   285  - [ ] get_next_line
   286  - [ ] minitalk (?)
   287  - [ ] pipex (?)
   288  - [ ] so_long (?)
   289  - [ ] Fdf (?)
   290  - [ ] fract-ol (?)
   291  - [ ] push_swap (?)
   292  - [ ] minishell (?)
   293  - [ ] Philosophers (?)
   294  - [ ] cub3d (?)
   295  - [ ] miniRT (?)
   296  - [ ] ft_containers (?)
   297  - [ ] ft_services (?)
   298  - [ ] Inception (?)
   299  - [ ] ft_irc (?)
   300  - [ ] webserv (?)
   301  - [ ] cpp module (?)
   302  
   303  # Credits
   304  
   305  ## [Contributors](https://github.com/study-group-99/pilates/graphs/contributors)
   306  
   307  Reviewers/Testers: <a href="https://github.com/ignan1">@ignan1</a>, <a href="https://github.com/Zyanite7">@Zyanite7</a>, <a href="https://github.com/LePlaYa">@LePlaYa</a>, <a href="https://github.com/dejanzivanov">@dejanzivanov</a>, <a href="https://github.com/Madasanya">@Madasanya</a>, <a href="https://github.com/Lillzz">@Lillzz</a>, <a href="https://github.com/berlintrabby">@berlintrabby</a>.
   308  
   309  ## Shoulders of giants
   310  Test cases for libft unit tests also came from: <a href="https://github.com/berlintrabby">@berlintrabby</a>, <a href="https://github.com/alelievr">@alelievr</a> & <a href="https://github.com/ska42">@ska42</a>.