Path: blob/main/tests/integration_tests/style/test_gitlint.py
1958 views
# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.1# SPDX-License-Identifier: Apache-2.02"""Tests ensuring desired style for commit messages."""34import os5import framework.utils as utils678def test_gitlint():9"""Fail if the default gitlint rules do not apply."""10os.environ['LC_ALL'] = 'C.UTF-8'11os.environ['LANG'] = 'C.UTF-8'12try:13utils.run_cmd('gitlint --commits origin/main..HEAD'14' -C ../.gitlint'15' --extra-path framework/gitlint_rules.py')16except ChildProcessError as error:17assert False, "Commit message violates gitlint rules: {}".format(error)181920