Skip to content

Commit

Permalink
Add issue and PR templates, modify test and readme (#77)
Browse files Browse the repository at this point in the history
Implemented new templates for bug reports, feature requests, and pull
requests to improve project workflow. Also made adjustments to
PackageTest and simplified the README, adding new contribution
guidelines. These changes aim to better guide contributors and improve
project maintenance.
  • Loading branch information
SmetDenis committed Mar 23, 2024
1 parent 97027d7 commit 339bd3a
Show file tree
Hide file tree
Showing 6 changed files with 161 additions and 21 deletions.
39 changes: 39 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
name: 🐞 Bug Report
about: Something is broken?
title: '[BUG]'
labels: bug
assignees: SmetDenis

---

### Describe the issue
A clear and concise description of what the bug is.


### To Reproduce
- [ ] Command you used `./csv-blueprint ...`
- [ ] Attach schema/csv file(s). If you can't share the file, please provide a minimal example that reproduces the issue.

```text
<!-- Copy-paste the output -->
```


### Expected behavior

<!-- A clear and concise description of what you expected to happen. -->


### Your environment

| Question | Answer |
|-----------------------|----------------------------------
| CSV Blueprint version | x.y.z
| OS | Linux, Windows, macOS
| PHP | 8.x.z
| Composer | 2.x.z
| Installation Method | Composer, Phar, Docker, GA, etc.

Any links to the CI logs or the repository, if any.
23 changes: 23 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
name: 🎉 Feature Request
about: You have a neat idea that should be implemented?
title: '[FEATURE]'
labels: enhancement
assignees: SmetDenis

---

### Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]


### Describe the solution you'd like
A clear and concise description of what you want to happen.


### Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.


### Additional context
Add any other context or screenshots about the feature request here.
42 changes: 42 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE/new_pr.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
name: 🎉 New Pull Request
about: You have implemented some neat idea that you want to make part of CSV Blueprint?
labels: enhancement
---

# Pull Request Template

## Description

Please include a summary of the change and which issue is fixed.
Also, include relevant motivation and context. List any dependencies that are required for this change.

Fixes # (issue)

## Type of change

Please delete options that are not relevant.

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] This change requires a documentation update


## How Has This Been Tested?

Please describe the tests that you ran to verify your changes.
Provide instructions so we can reproduce. Please also list any relevant details for your test configuration.

- [ ] Test A
- [ ] Test B


## Checklist:

- [ ] `make test` passes.
- [ ] `make codestyle` passes.
- [ ] I have made corresponding changes to the documentation
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged and published in downstream modules
23 changes: 23 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Contributing

If you have any ideas or suggestions, feel free to open an issue or create a pull request.

```sh
# Fork the repo and build project
git clone git@github.com:jbzoo/csv-blueprint.git ./jbzoo-csv-blueprint
cd ./jbzoo-csv-blueprint
make build

# Make your local changes

# Autofix code style
make test-phpcsfixer-fix test-phpcs

# Run all tests and check code style
make test
make codestyle

# Create your pull request and check all tests in CI (Github Actions)
# ???
# Profit!
```
26 changes: 12 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# JBZoo / Csv-Blueprint
# JBZoo / CSV Blueprint

[![CI](https://github.com/JBZoo/Csv-Blueprint/actions/workflows/main.yml/badge.svg?branch=master)](https://github.com/JBZoo/Csv-Blueprint/actions/workflows/main.yml?query=branch%3Amaster) [![CI](https://github.com/JBZoo/Csv-Blueprint/actions/workflows/demo.yml/badge.svg?branch=master)](https://github.com/JBZoo/Csv-Blueprint/actions/workflows/demo.yml?query=branch%3Amaster) [![CI](https://github.com/JBZoo/Csv-Blueprint/actions/workflows/release-docker.yml/badge.svg?branch=master)](https://github.com/JBZoo/Csv-Blueprint/actions/workflows/release-docker.yml?query=branch%3Amaster) [![Coverage Status](https://coveralls.io/repos/github/JBZoo/Csv-Blueprint/badge.svg?branch=master)](https://coveralls.io/github/JBZoo/Csv-Blueprint?branch=master) [![Psalm Coverage](https://shepherd.dev/github/JBZoo/Csv-Blueprint/coverage.svg)](https://shepherd.dev/github/JBZoo/Csv-Blueprint)
[![Stable Version](https://poser.pugx.org/jbzoo/csv-blueprint/version)](https://packagist.org/packages/jbzoo/csv-blueprint/) [![Total Downloads](https://poser.pugx.org/jbzoo/csv-blueprint/downloads)](https://packagist.org/packages/jbzoo/csv-blueprint/stats) [![Docker Pulls](https://img.shields.io/docker/pulls/jbzoo/csv-blueprint.svg)](https://hub.docker.com/r/jbzoo/csv-blueprint) [![Dependents](https://poser.pugx.org/jbzoo/csv-blueprint/dependents)](https://packagist.org/packages/jbzoo/csv-blueprint/dependents?order_by=downloads) [![GitHub License](https://img.shields.io/github/license/jbzoo/csv-blueprint)](https://github.com/JBZoo/Csv-Blueprint/blob/master/LICENSE)
[![CI](https://github.com/JBZoo/Csv-Blueprint/actions/workflows/main.yml/badge.svg?branch=master)](https://github.com/JBZoo/Csv-Blueprint/actions/workflows/main.yml?query=branch%3Amaster) [![CI](https://github.com/JBZoo/Csv-Blueprint/actions/workflows/demo.yml/badge.svg)](https://github.com/JBZoo/Csv-Blueprint/actions/workflows/demo.yml) [![CI](https://github.com/JBZoo/Csv-Blueprint/actions/workflows/release-docker.yml/badge.svg)](https://github.com/JBZoo/Csv-Blueprint/actions/workflows/release-docker.yml) [![Coverage Status](https://coveralls.io/repos/github/JBZoo/Csv-Blueprint/badge.svg?branch=master)](https://coveralls.io/github/JBZoo/Csv-Blueprint?branch=master) [![Psalm Coverage](https://shepherd.dev/github/JBZoo/Csv-Blueprint/coverage.svg)](https://shepherd.dev/github/JBZoo/Csv-Blueprint)
[![Stable Version](https://poser.pugx.org/jbzoo/csv-blueprint/version)](https://packagist.org/packages/jbzoo/csv-blueprint/) [![Total Downloads](https://poser.pugx.org/jbzoo/csv-blueprint/downloads)](https://packagist.org/packages/jbzoo/csv-blueprint/stats) [![Docker Pulls](https://img.shields.io/docker/pulls/jbzoo/csv-blueprint.svg)](https://hub.docker.com/r/jbzoo/csv-blueprint/tags) [![GitHub License](https://img.shields.io/github/license/jbzoo/csv-blueprint)](https://github.com/JBZoo/Csv-Blueprint/blob/master/LICENSE)

<!-- rules-counter -->
[![Static Badge](https://img.shields.io/badge/Rules-103-green?label=Total%20Number%20of%20Rules&labelColor=darkgreen&color=gray)](schema-examples/full.yml) [![Static Badge](https://img.shields.io/badge/Rules-55-green?label=Cell%20Value&labelColor=blue&color=gray)](src/Rules/Cell) [![Static Badge](https://img.shields.io/badge/Rules-45-green?label=Aggregate%20Column&labelColor=blue&color=gray)](src/Rules/Aggregate) [![Static Badge](https://img.shields.io/badge/Rules-3-green?label=Extra%20Checks&labelColor=blue&color=gray)](#extra-checks) [![Static Badge](https://img.shields.io/badge/Rules-329-green?label=Plan%20to%20add&labelColor=gray&color=gray)](tests/schemas/todo.yml)
Expand Down Expand Up @@ -426,41 +426,39 @@ Ensure you have Docker installed on your machine.

```sh
# Pull the Docker image
docker pull jbzoo/csv-blueprint
docker pull jbzoo/csv-blueprint:latest

# Run the tool inside Docker
docker run --rm \
--workdir=/parent-host \
-v $(pwd):/parent-host \
jbzoo/csv-blueprint \
jbzoo/csv-blueprint:latest \
validate:csv \
--csv=./tests/fixtures/demo.csv \
--schema=./tests/schemas/demo_invalid.yml
```

**Status: WIP**. Sometimes it doesn't work on some platforms. But you can build it from source.

```sh
# OR build it from source.
git clone git@github.com:JBZoo/Csv-Blueprint.git csv-blueprint
cd csv-blueprint
make build-docker # local tag is "jbzoo/csv-blueprint"
make build-docker # local tag is "jbzoo/csv-blueprint:local"
```


### PHP binary
Ensure you have PHP installed on your machine.

**Status: WIP**. It's not released yet. But you can build it from source. See manual above and `./build/csv-blueprint.phar` file.

```sh
# download the latest version

wget https://github.com/JBZoo/Csv-Blueprint/releases/latest/download/csv-blueprint.phar
chmod +x ./csv-blueprint.phar
./csv-blueprint.phar validate:csv \
--csv=./tests/fixtures/demo.csv \
--schema=./tests/schemas/demo_invalid.yml
```

```sh

# OR build from source
git clone git@github.com:jbzoo/csv-blueprint.git csv-blueprint
cd csv-blueprint
make build
Expand Down Expand Up @@ -700,7 +698,7 @@ make build
# Make your local changes

# Autofix code style
make test-phpcsfixer-fix
make test-phpcsfixer-fix test-phpcs

# Run all tests and check code style
make test
Expand Down
29 changes: 22 additions & 7 deletions tests/PackageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,13 @@ final class PackageTest extends \JBZoo\Codestyle\PHPUnit\AbstractPackageTest
protected string $packageName = 'Csv-Blueprint';

protected array $params = [
// Packagist
'packagist_latest_stable_version' => true,
'packagist_latest_unstable_version' => true,
'packagist_license' => true,
'packagist_version' => true,

'packagist_dependents' => true,
'packagist_suggesters' => true,
'packagist_dependents' => false,
'packagist_suggesters' => false,

'packagist_downloads_total' => true,
'packagist_downloads_daily' => true,
Expand Down Expand Up @@ -96,8 +95,8 @@ protected function checkBadgeGithubActionsDemo(): ?string
return $this->getPreparedBadge(
$this->getBadge(
'CI',
$path . '/demo.yml/badge.svg?branch=master',
$path . '/demo.yml?query=branch%3Amaster',
$path . '/demo.yml/badge.svg',
$path . '/demo.yml',
),
);
}
Expand All @@ -109,9 +108,25 @@ protected function checkBadgeGithubActionsReleaseDocker(): ?string
return $this->getPreparedBadge(
$this->getBadge(
'CI',
$path . '/release-docker.yml/badge.svg?branch=master',
$path . '/release-docker.yml?query=branch%3Amaster',
$path . '/release-docker.yml/badge.svg',
$path . '/release-docker.yml',
),
);
}

protected function checkBadgeDockerPulls(): ?string
{
return $this->getPreparedBadge(
$this->getBadge(
'Docker Pulls',
'https://img.shields.io/docker/pulls/__VENDOR__/__PACKAGE__.svg',
'https://hub.docker.com/r/__VENDOR__/__PACKAGE__/tags',
),
);
}

protected function getTitle(): string
{
return '# JBZoo / CSV Blueprint';
}
}

0 comments on commit 339bd3a

Please sign in to comment.