diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index e7be47467ea..879bd24a622 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -8,6 +8,7 @@ if you have questions about contributing. +- [ ] commit message follows format outlined [here](https://modin.readthedocs.io/en/latest/contributing.html) - [ ] passes `flake8 modin` - [ ] passes `black --check modin` - [ ] signed commit with `git commit -s` diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 808c3d8e902..9da547594df 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,24 @@ name: ci on: pull_request jobs: + lint-commit: + name: lint (commit) + runs-on: ubuntu-latest + env: + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - uses: actions/setup-node@v1 + with: + node-version: "10.x" + - run: npm install --save-dev @commitlint/{config-conventional,cli} commitlint-plugin-jira-rules commitlint-config-jira + - name: Add dependencies for commitlint action + run: echo "::set-env name=NODE_PATH::$GITHUB_WORKSPACE/node_modules" + - run: git remote add upstream https://github.com/modin-project/modin.git + - run: git fetch upstream + - run: npx commitlint --from upstream/master --to HEAD --verbose lint-black: name: lint (black) runs-on: ubuntu-latest @@ -68,7 +86,7 @@ jobs: - run: pip install -r requirements.txt - run: python -m pytest modin/test/test_publisher.py modin/data_management/test/test_dispatcher.py test-all: - needs: [lint-flake8, lint-black, test-api, test-headers] + needs: [lint-commit, lint-flake8, lint-black, test-api, test-headers] runs-on: ubuntu-latest strategy: matrix: @@ -108,7 +126,7 @@ jobs: if: matrix.part == 3 - run: bash <(curl -s https://codecov.io/bash) test-windows: - needs: [lint-flake8, lint-black, test-api, test-headers] + needs: [lint-commit, lint-flake8, lint-black, test-api, test-headers] runs-on: windows-latest strategy: matrix: @@ -144,7 +162,7 @@ jobs: - run: choco install codecov - run: codecov -f .\coverage.xml -t ${{secrets.CODECOV_TOKEN}} test-pyarrow: - needs: [lint-flake8, lint-black, test-api, test-headers] + needs: [lint-commit, lint-flake8, lint-black, test-api, test-headers] runs-on: ubuntu-latest strategy: matrix: diff --git a/commitlint.config.js b/commitlint.config.js new file mode 100644 index 00000000000..c022602cab7 --- /dev/null +++ b/commitlint.config.js @@ -0,0 +1,10 @@ +module.exports = { + plugins: ['commitlint-plugin-jira-rules'], + extends: ['jira'], + rules: { + "header-max-length": [2, "always", 50], + "signed-off-by": [2, "always", "Signed-off-by"], + "jira-task-id-max-length": [0, "always", 10], + "jira-task-id-project-key": [2, "always", ["FEAT", "DOCS", "FIX", "REFACTOR", "TEST"]], + } +} diff --git a/docs/contributing.rst b/docs/contributing.rst index c157bc4be88..ff7f73a0ab2 100644 --- a/docs/contributing.rst +++ b/docs/contributing.rst @@ -80,6 +80,30 @@ commits and push them to GitHub. If you've pushed your changes to GitHub already you'll need to force push your branch after this with ``git push -f``. +Commit Message formatting +------------------------- +To ensure that all commit messages in the master branch follow a specific format, we +enforce that all commit messages must follow the following format: + +.. code-block:: bash + + FEAT-#9999: Add `DataFrame.rolling` functionality, to enable rolling window operations + +The ``FEAT`` component represents the type of commit. This component of the commit +message can be one of the following: + +* FEAT: A new feature that is added +* DOCS: Documentation improvements or updates +* FIX: A bugfix contribution +* REFACTOR: Moving or removing code without change in functionality +* TEST: Test updates or improvements + +The ``#9999`` component of the commit message should be the issue number in the Modin +GitHub issue tracker: https://github.com/modin-project/modin/issues. This is important +because it links commits to their issues. + +The commit message should follow a colon (:) and be descriptive and succinct. + Development Dependencies ------------------------