blob: 13e84d37233be1b5bf511dbebc4a4d836577b3f7 [file] [log] [blame]
# Copyright (c) 2022 Project CHIP Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import logging
import stringcase
def RegisterCommonFilters(filtermap):
"""
Register filters that are NOT considered platform-generator specific.
Codegen often needs standardized names, like "method names are CamelCase"
or "command names need-to-be-spinal-case" so these filters are often
generally registered on all generators.
"""
# General casing for output naming
filtermap['camelcase'] = stringcase.camelcase
filtermap['capitalcase'] = stringcase.capitalcase
filtermap['constcase'] = stringcase.constcase
filtermap['pascalcase'] = stringcase.pascalcase
filtermap['snakecase'] = stringcase.snakecase
filtermap['spinalcase'] = stringcase.spinalcase