Skip to content

Commit

Permalink
[WIP] Add guideline on branches to CONTRIBUTING.md
Browse files Browse the repository at this point in the history
Proposal per discussion in codemeta#347 (not finalize yet). In general:

- `develop` for vocabulary changes
- `master` for non-vocabulary changes

This will resolve codemeta#347
  • Loading branch information
bact committed Feb 16, 2024
1 parent cce85db commit 45ab4b4
Showing 1 changed file with 19 additions and 9 deletions.
28 changes: 19 additions & 9 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
# Contribution Guide

This guide is intended for people who want to contribute to content of the Git repository.
This guide is intended for people who want to contribute to content of CodeMeta Git repository.

## Layout

The repository is laid out as such:

* `scripts/`: Python scripts to manipulate the crosswalk table
* `properties_description.csv`: A CSV files with human-readable information about each CodeMeta property.
* `crosswalks/*.csv`: Two-column CSV files, that map between CodeMeta's properties and platform-specific terms.
* `crosswalk.csv`: An aggregated table of all CSV files mentionned above; intended to be the main resource for readers.
- `scripts/`: Python scripts to manipulate the crosswalk table.
- `properties_description.csv`: A CSV files with human-readable information about each CodeMeta property.
- `crosswalks/*.csv`: Two-column CSV files, that map between CodeMeta's properties and platform-specific terms.
- `crosswalk.csv`: An aggregated table of all CSV files mentionned above; intended to be the main resource for readers. Meant to be generated by a script and not be manually edited.

The repository has two major branches:

- `develop`: Any contribution that will change CodeMeta vocabulary should target this branch. Adding a new property, amending or removing an existing property will change the vocabulary.
- `master`: All other non-vocabulary changes, including mapping and crosswalk updates, should target this branch.
- A minor amendment to a property *decription* (not property *name* or *type*) can target this branch as well, as long as it does not change the semantic of the property.

## About pull requests

Expand All @@ -20,7 +26,7 @@ Do not commit changes to `crosswalk.csv`, as these will very likely create confl
## Editing an existing mapping

Open the CSV file in `crosswalks/` that contains your mapping.
You may change the second column (ie. what comes after the comma on each line) to match the terms of the platform your new mapping covers.
You may change the second column (i.e. what comes after the comma on each line) to match the terms of the platform your new mapping covers.

Then, run `scripts/aggregate.py`. This will build the new `crosswalk.csv` using the updated version of your mapping; and raise an error if you made a mistake (such as editing the first column).

Expand All @@ -30,14 +36,18 @@ You can now commit your changes and send a pull request. Don't forget to **exclu

To add a new platform mapping to CodeMeta, you have to add a new CSV file to `crosswalks/`. The filename is free-form, but please to avoid non-ASCII characters. The name is not used to build the aggregated table.

You may copy any other CSV file from `crosswalks/` to write yours; the refer to the "Editing an existing mapping" section.
You may copy any other CSV file from `crosswalks/` to write yours; then refer to the "Editing an existing mapping" section.

## Adding a new CodeMeta property

1) **Adding the new property:**
To do so, you should first edit `properties_description.csv` and add a line with the appropriate cells there; and edit `codemeta.jsonld` as well.

Then, add that line to each `crosswalks/*.csv` file, in the same position as in `properties_description.csv`.
2) **Update all existing mappings with the new property name:**
Add the new property name to each `crosswalks/*.csv` file, in the same position as in `properties_description.csv`.

Then, run `scripts/aggregate.py`. This will build the new `crosswalk.csv` with the new property; and raise an error if you made a mistake (such as editing the first column).
3) **Test:**
Run `scripts/aggregate.py`. This will build the new `crosswalk.csv` with the new property; and raise an error if you made a mistake (such as editing the first column).

4) **Commit changes:**
You may then create a commit and send a pull request. Don't forget to **exclude** `crosswalk.csv` from the commit.

0 comments on commit 45ab4b4

Please sign in to comment.