├── .github ├── ISSUE_TEMPLATE │ ├── config.yml │ ├── feature_request.md │ └── bug_report.md ├── CODEOWNERS ├── labeler.yml └── workflows │ ├── labeler.yaml │ └── ci.yaml ├── images └── kibble-logo.png ├── NOTICE ├── license-templates ├── LICENSE.txt └── LICENSE.rst ├── tests ├── __init__.py └── cli │ ├── __init__.py │ ├── commands │ ├── __init__.py │ ├── test_config_command.py │ ├── test_server_command.py │ ├── test_version_command.py │ ├── test_scanners_command.py │ └── test_db_command.py │ └── test_parser.py ├── kibble ├── __init__.py ├── cli │ ├── __init__.py │ ├── commands │ │ ├── __init__.py │ │ ├── version_command.py │ │ ├── server_command.py │ │ ├── config_command.py │ │ ├── db_command.py │ │ └── scanners_command.py │ └── parser.py ├── database │ └── __init__.py ├── scanners │ └── __init__.py ├── server │ └── __init__.py ├── __main__.py └── version.py ├── .dockerignore ├── yamllint-config.yml ├── pyproject.toml ├── CODE_OF_CONDUCT.md ├── Dockerfile.dev ├── .markdownlint.yml ├── .asf.yaml ├── setup.cfg ├── scripts └── pre_commit_generate_cli_help.sh ├── README.md ├── .gitignore ├── setup.py ├── CONTRIBUTING.md ├── .pre-commit-config.yaml ├── LICENSE └── pylintrc /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | --- 2 | blank_issues_enabled: false 3 | -------------------------------------------------------------------------------- /images/kibble-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/kibble/HEAD/images/kibble-logo.png -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | # All repo 2 | * @turbaszek @michalslowikowski00 3 | 4 | # Docs stuff 5 | README.md @sharanf 6 | CODE_OF_CONDUCT.md @sharanf 7 | CONTRIBUTING.md @sharanf 8 | docs/ @sharanf 9 | -------------------------------------------------------------------------------- /NOTICE: -------------------------------------------------------------------------------- 1 | Apache Kibble 2 | Copyright 2017, the Apache Software Foundation 3 | 4 | This product includes software developed at 5 | The Apache Software Foundation (http://www.apache.org/). 6 | 7 | The licenses and noticesd listed below are for intellectual property 8 | used in Apache Kibble, not covered by the Apache License. 9 | -------------------------------------------------------------------------------- /.github/labeler.yml: -------------------------------------------------------------------------------- 1 | --- 2 | area:api: 3 | - 'kibble/server/*' 4 | 5 | area:cli: 6 | - 'kibble/cli/*' 7 | 8 | area:scanners: 9 | - 'kibble/scanners/*' 10 | 11 | area:ui: 12 | - 'ui/*' 13 | 14 | area:docs: 15 | - 'docs/*' 16 | - '*.md' 17 | 18 | aread:database: 19 | - 'kibble/database/*' 20 | 21 | area:dev: 22 | - '.github/*' 23 | - '.pre-commit.config.yaml' 24 | - '.asf.yaml' 25 | - 'Dockerfile*' 26 | - 'docker*' 27 | - 'setup.*' 28 | -------------------------------------------------------------------------------- /license-templates/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Licensed to the Apache Software Foundation (ASF) under one 2 | or more contributor license agreements. See the NOTICE file 3 | distributed with this work for additional information 4 | regarding copyright ownership. The ASF licenses this file 5 | to you under the Apache License, Version 2.0 (the 6 | "License"); you may not use this file except in compliance 7 | with the License. You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, 12 | software distributed under the License is distributed on an 13 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | KIND, either express or implied. See the License for the 15 | specific language governing permissions and limitations 16 | under the License. 17 | -------------------------------------------------------------------------------- /tests/__init__.py: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | -------------------------------------------------------------------------------- /kibble/__init__.py: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | -------------------------------------------------------------------------------- /kibble/cli/__init__.py: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | -------------------------------------------------------------------------------- /tests/cli/__init__.py: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | -------------------------------------------------------------------------------- /kibble/database/__init__.py: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | -------------------------------------------------------------------------------- /kibble/scanners/__init__.py: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | -------------------------------------------------------------------------------- /kibble/server/__init__.py: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | -------------------------------------------------------------------------------- /kibble/cli/commands/__init__.py: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | -------------------------------------------------------------------------------- /tests/cli/commands/__init__.py: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | -------------------------------------------------------------------------------- /license-templates/LICENSE.rst: -------------------------------------------------------------------------------- 1 | .. Licensed to the Apache Software Foundation (ASF) under one 2 | or more contributor license agreements. See the NOTICE file 3 | distributed with this work for additional information 4 | regarding copyright ownership. The ASF licenses this file 5 | to you under the Apache License, Version 2.0 (the 6 | "License"); you may not use this file except in compliance 7 | with the License. You may obtain a copy of the License at 8 | 9 | .. http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | .. Unless required by applicable law or agreed to in writing, 12 | software distributed under the License is distributed on an 13 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | KIND, either express or implied. See the License for the 15 | specific language governing permissions and limitations 16 | under the License. 17 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Idea or feature request 4 | title: '' 5 | labels: 'kind:feature' 6 | assignees: '' 7 | 8 | --- 9 | 10 | 20 | 21 | **Description** 22 | 23 | 24 | **Use case** 25 | 31 | 32 | **Related Issues** 33 | 34 | -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | # Ignore everything 2 | ** 3 | 4 | # Allow only these directories 5 | !kibble 6 | !tests 7 | !scripts 8 | !licenses 9 | 10 | # Setup/version configuration 11 | !setup.cfg 12 | !setup.py 13 | 14 | # Add required dev configs 15 | !.dockerignore 16 | !.markdownlint.yml 17 | !.pre-commit-config.yaml 18 | !pylintrc 19 | !pyproject.toml 20 | !yamllint-config.yml 21 | 22 | # Exclude python generated files 23 | **/__pycache__/ 24 | **/*.py[cod] 25 | **/*$py.class 26 | **/.pytest_cache/ 27 | **/env/ 28 | **/build/ 29 | **/develop-eggs/ 30 | **/dist/ 31 | **/downloads/ 32 | **/eggs/ 33 | **/.eggs/ 34 | **/lib/ 35 | **/lib64/ 36 | **/parts/ 37 | **/sdist/ 38 | **/var/ 39 | **/wheels/ 40 | **/*.egg-info/ 41 | **/.installed.cfg 42 | **/*.egg 43 | 44 | # Exclude temporary vi files 45 | **/*~ 46 | 47 | # Exclude output files 48 | **/*.out 49 | 50 | # Exclude auto-generated Finder files on Mac OS 51 | **/.DS_Store 52 | **/Thumbs.db 53 | -------------------------------------------------------------------------------- /yamllint-config.yml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | --- 18 | extends: default 19 | 20 | rules: 21 | line-length: 22 | max: 110 23 | -------------------------------------------------------------------------------- /kibble/__main__.py: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | from kibble.cli.parser import cli 18 | 19 | 20 | def main(): 21 | """Main executable function""" 22 | cli() 23 | 24 | 25 | if __name__ == "__main__": 26 | main() 27 | -------------------------------------------------------------------------------- /kibble/cli/commands/version_command.py: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | __all__ = ["version_cmd"] 19 | 20 | import click 21 | 22 | from kibble.version import version 23 | 24 | 25 | @click.command(name="version") 26 | def version_cmd(): 27 | """Show Kibble version""" 28 | click.echo(version) 29 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Problems or issues with Kibble projects 4 | title: '' 5 | labels: 'kind:bug' 6 | assignees: '' 7 | 8 | --- 9 | 10 | 19 | 20 | **Description:** 21 | 26 | 27 | **Reproduction steps:** 28 | 34 | **Actual result:** 35 | 36 | 37 | **OS:** 38 | 39 | 40 | **Logs:** 41 | 42 | 43 | **Other:** 44 | 47 | -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | [tool.black] 19 | line-length = 110 20 | target-version = ['py38'] 21 | 22 | [tool.pytest.ini_options] 23 | minversion = "6.0" 24 | addopts = "-rasl --verbose --color=yes" 25 | testpaths = [ 26 | "tests", 27 | ] 28 | faulthandler_timeout = 480 29 | log_level = "INFO" 30 | -------------------------------------------------------------------------------- /kibble/cli/commands/server_command.py: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | __all__ = ["server_group"] 19 | 20 | import click 21 | 22 | 23 | @click.group(name="server") 24 | def server_group(): 25 | """API server commands""" 26 | 27 | 28 | @server_group.command() 29 | def start(): 30 | """Start API server""" 31 | click.echo("To be implemented!") 32 | -------------------------------------------------------------------------------- /kibble/cli/commands/config_command.py: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | __all__ = ["config_group"] 19 | 20 | import click 21 | 22 | 23 | @click.group(name="config") 24 | def config_group(): 25 | """Access configuration""" 26 | 27 | 28 | @config_group.command() 29 | def show(): 30 | """Shows configuration""" 31 | click.echo("To be implemented!") 32 | -------------------------------------------------------------------------------- /.github/workflows/labeler.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | --- 18 | name: "PR labeler" 19 | on: # yamllint disable-line rule:truthy 20 | - pull_request_target 21 | 22 | jobs: 23 | triage: 24 | name: Label 25 | runs-on: ubuntu-latest 26 | steps: 27 | - uses: actions/labeler@main 28 | with: 29 | repo-token: "${{ secrets.GITHUB_TOKEN }}" 30 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | 19 | 20 | # Code of Conduct 21 | 22 | The Apache Kibble project follows the 23 | [Apache Software Foundation code of conduct](https://www.apache.org/foundation/policies/conduct.html). 24 | 25 | If you observe behavior that violates those rules please follow the 26 | [ASF reporting guidelines](https://www.apache.org/foundation/policies/conduct#reporting-guidelines). 27 | -------------------------------------------------------------------------------- /tests/cli/commands/test_config_command.py: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | from click.testing import CliRunner 19 | 20 | from kibble.cli.commands.config_command import config_group 21 | 22 | 23 | class TestConfigCommand: 24 | def test_show(self): 25 | runner = CliRunner() 26 | result = runner.invoke(config_group, ["show"]) 27 | 28 | assert result.exit_code == 0 29 | assert result.output.strip() == "To be implemented!" 30 | -------------------------------------------------------------------------------- /tests/cli/commands/test_server_command.py: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | from click.testing import CliRunner 19 | 20 | from kibble.cli.commands.server_command import server_group 21 | 22 | 23 | class TestWebserverCommand: 24 | def test_start(self): 25 | runner = CliRunner() 26 | result = runner.invoke(server_group, ["start"]) 27 | 28 | assert result.exit_code == 0 29 | assert result.output.strip() == "To be implemented!" 30 | -------------------------------------------------------------------------------- /tests/cli/test_parser.py: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | from click.testing import CliRunner 19 | 20 | from kibble.cli.parser import cli 21 | 22 | 23 | class TestCliParser: 24 | def test_commands_are_sorted_in_cli(self): 25 | cmds = cli.list_commands(None) 26 | assert cmds == sorted(cmds) 27 | 28 | def test_commands(self): 29 | runner = CliRunner() 30 | result = runner.invoke(cli) 31 | assert result.exit_code == 0 32 | -------------------------------------------------------------------------------- /kibble/version.py: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | __all__ = ["version"] 19 | 20 | from importlib import metadata 21 | 22 | try: 23 | version = metadata.version("apache-kibble") 24 | except metadata.PackageNotFoundError: 25 | import logging 26 | 27 | log = logging.getLogger(__name__) 28 | log.warning("Package metadata could not be found. Overriding it with version found in setup.py") 29 | from setup import VERSION as version 30 | 31 | del metadata 32 | -------------------------------------------------------------------------------- /tests/cli/commands/test_version_command.py: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | from click.testing import CliRunner 19 | 20 | from kibble.cli.commands.version_command import version_cmd 21 | from kibble.version import version 22 | 23 | 24 | class TestVersionCommand: 25 | def test_version(self): 26 | runner = CliRunner() 27 | result = runner.invoke(version_cmd) 28 | 29 | assert result.exit_code == 0 30 | assert result.output.strip() == version 31 | -------------------------------------------------------------------------------- /Dockerfile.dev: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | FROM python:3.8 19 | 20 | ENV KIBBLE_DIR="/opt/kibble" 21 | 22 | # Install some dependencies 23 | RUN apt-get update \ 24 | && apt-get install dumb-init 25 | 26 | # Copy all sources (we use .dockerignore for excluding) 27 | ADD . ${KIBBLE_DIR} 28 | 29 | # Install kibble and required dev dependencies 30 | WORKDIR ${KIBBLE_DIR} 31 | 32 | RUN pip install --upgrade pip 33 | RUN pip install -e ".[devel]" 34 | 35 | # Run sanity check 36 | RUN kibble --help 37 | 38 | # Use dumb-init as entrypoint to improve signal handling 39 | # https://github.com/Yelp/dumb-init 40 | ENTRYPOINT ["/usr/bin/dumb-init", "--"] 41 | -------------------------------------------------------------------------------- /kibble/cli/parser.py: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | import click 19 | 20 | from kibble.cli.commands.config_command import config_group 21 | from kibble.cli.commands.db_command import db_group 22 | from kibble.cli.commands.scanners_command import scanners_group 23 | from kibble.cli.commands.server_command import server_group 24 | from kibble.cli.commands.version_command import version_cmd 25 | 26 | 27 | @click.group() 28 | def cli(): 29 | """Manage and configure Apache Kibble instance.""" 30 | 31 | 32 | # Try to keep this list sorted A-Z 33 | cli.add_command(config_group) 34 | cli.add_command(db_group) 35 | cli.add_command(server_group) 36 | cli.add_command(scanners_group) 37 | cli.add_command(version_cmd) 38 | -------------------------------------------------------------------------------- /kibble/cli/commands/db_command.py: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | __all__ = ["db_group"] 19 | 20 | import click 21 | 22 | 23 | @click.group(name="db") 24 | def db_group(): 25 | """Manage database""" 26 | 27 | 28 | @db_group.command(name="init") 29 | def db_init(): 30 | """Initialize database""" 31 | click.echo("To be implemented!") 32 | 33 | 34 | def _abort_reset(ctx, _, value): 35 | if not value: 36 | ctx.abort() 37 | 38 | 39 | @db_group.command(name="reset") 40 | @click.option( 41 | "--yes", 42 | is_flag=True, 43 | callback=_abort_reset, 44 | expose_value=False, 45 | prompt="This will reset database. Do you want to continue?", 46 | ) 47 | def db_reset(): 48 | """Reset database""" 49 | click.echo("To be implemented!") 50 | -------------------------------------------------------------------------------- /.markdownlint.yml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | # 18 | --- 19 | # MD004/ul-style 20 | MD004: false 21 | 22 | # MD007/ul-indent 23 | MD007: false 24 | 25 | # MD012/no-multiple-blanks 26 | MD012: false 27 | 28 | # MD013 Line length 29 | MD013: false 30 | 31 | # MD024/no-duplicate-heading/no-duplicate-header 32 | MD024: false 33 | 34 | # MD026/no-trailing-punctuation 35 | MD026: false 36 | 37 | # MD029/ol-prefix 38 | MD029: false 39 | 40 | # MD030/list-marker-space 41 | MD030: false 42 | 43 | # MD033/no-inline-html 44 | MD033: false 45 | 46 | # MD034/no-bare-urls 47 | MD034: false 48 | 49 | # MD036/no-emphasis-as-heading/no-emphasis-as-header 50 | MD036: false 51 | 52 | # MD040/fenced-code-language 53 | MD040: false 54 | 55 | # MD041/first-line-heading/first-line-h1 56 | MD041: false 57 | -------------------------------------------------------------------------------- /.github/workflows/ci.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | --- 18 | name: CI 19 | on: # yamllint disable-line rule:truthy 20 | push: 21 | branches: ['main'] 22 | pull_request: 23 | branches: ['main'] 24 | 25 | jobs: 26 | statics: 27 | name: Static checks 28 | runs-on: ubuntu-latest 29 | steps: 30 | - uses: actions/checkout@v2 31 | - uses: actions/setup-python@v2 32 | - run: pip install '.[devel]' 33 | - run: pre-commit install 34 | - run: pre-commit run --all-files 35 | run-tests: 36 | name: Run Tests 37 | runs-on: ubuntu-latest 38 | steps: 39 | - uses: actions/checkout@v2 40 | - uses: actions/setup-python@v2 41 | with: 42 | python-version: '3.8' 43 | - run: pip install '.[devel]' 44 | - run: pytest tests 45 | -------------------------------------------------------------------------------- /kibble/cli/commands/scanners_command.py: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | __all__ = ["scanners_group"] 19 | 20 | import click 21 | 22 | 23 | @click.group(name="scanners") 24 | def scanners_group(): 25 | """Configure and trigger scanners""" 26 | 27 | 28 | @scanners_group.command() 29 | def add(): 30 | """Add new scanner configuration""" 31 | click.echo("To be implemented!") 32 | 33 | 34 | @scanners_group.command(name="list") 35 | def list_scanners(): 36 | """List all available scanners""" 37 | scanners_list = ["AbcScanner", "XyzeScanner"] 38 | for scanner in scanners_list: 39 | click.echo(f"- {scanner}") 40 | 41 | 42 | @scanners_group.command() 43 | @click.argument("scanner_name") 44 | def run(scanner_name: str): 45 | """Trigger a scanning process for given scanner""" 46 | click.echo(f"Running {scanner_name}") 47 | -------------------------------------------------------------------------------- /.asf.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | # https://cwiki.apache.org/confluence/display/INFRA/git+-+.asf.yaml+features 19 | --- 20 | github: 21 | description: "Apache Kibble - a tool to collect, aggregate and visualize data about any software project" 22 | homepage: https://kibble.apache.org/ 23 | labels: 24 | - kibble 25 | - big-data 26 | - open-source 27 | - python 28 | - visualization 29 | 30 | features: 31 | # Enable issues management 32 | issues: true 33 | # Enable wiki for documentation 34 | wiki: false 35 | # Enable projects for project management boards 36 | projects: true 37 | 38 | enabled_merge_buttons: 39 | squash: true 40 | merge: false 41 | rebase: false 42 | 43 | protected_branches: 44 | main: 45 | required_pull_request_reviews: 46 | required_approving_review_count: 1 47 | -------------------------------------------------------------------------------- /setup.cfg: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | [metadata] 19 | name = Kibble 20 | summary = Apache Kibble is a tool to collect, aggregate and visualize data about any software project that uses commonly known tools. 21 | description-file = README.md 22 | author = Apache Kibble 23 | author-email = dev@kibble.apache.org 24 | license = Apache License, Version 2.0 25 | license_files = 26 | LICENSE 27 | NOTICE 28 | 29 | [bdist_wheel] 30 | python-tag=py3 31 | 32 | 33 | [files] 34 | packages = kibble 35 | 36 | [easy_install] 37 | 38 | [mypy] 39 | ignore_missing_imports = True 40 | no_implicit_optional = True 41 | warn_redundant_casts = True 42 | warn_unused_ignores = False 43 | pretty = True 44 | 45 | [isort] 46 | line_length=110 47 | combine_as_imports = true 48 | default_section = THIRDPARTY 49 | known_first_party=tests 50 | # Need to be consistent with the exclude config defined in pre-commit-config.yaml 51 | skip=build,.tox,venv 52 | profile = black 53 | -------------------------------------------------------------------------------- /tests/cli/commands/test_scanners_command.py: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | from click.testing import CliRunner 19 | 20 | from kibble.cli.commands.scanners_command import scanners_group 21 | 22 | 23 | class TestScannerCommand: 24 | def test_add(self): 25 | runner = CliRunner() 26 | result = runner.invoke(scanners_group, ["add"]) 27 | 28 | assert result.exit_code == 0 29 | assert result.output.strip() == "To be implemented!" 30 | 31 | def test_list(self): 32 | runner = CliRunner() 33 | result = runner.invoke(scanners_group, ["list"]) 34 | 35 | assert result.exit_code == 0 36 | assert result.output.strip() == "- AbcScanner\n- XyzeScanner" 37 | 38 | def test_run(self): 39 | runner = CliRunner() 40 | result = runner.invoke(scanners_group, ["run", "TestScanner"]) 41 | 42 | assert result.exit_code == 0 43 | assert result.output.strip() == "Running TestScanner" 44 | -------------------------------------------------------------------------------- /tests/cli/commands/test_db_command.py: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | from click.testing import CliRunner 19 | 20 | from kibble.cli.commands.db_command import db_group 21 | 22 | 23 | class TestDbCommand: 24 | def test_init(self): 25 | runner = CliRunner() 26 | result = runner.invoke(db_group, ["init"]) 27 | 28 | assert result.exit_code == 0 29 | assert result.output.strip() == "To be implemented!" 30 | 31 | def test_reset_no(self): 32 | runner = CliRunner() 33 | result = runner.invoke(db_group, ["reset"], input="N") 34 | 35 | msg = "This will reset database. Do you want to continue? [y/N]: N\nAborted!" 36 | assert result.output.strip() == msg 37 | assert result.exit_code == 1 38 | 39 | def test_reset_yes(self): 40 | runner = CliRunner() 41 | result = runner.invoke(db_group, ["reset", "--yes"]) 42 | 43 | assert result.exit_code == 0 44 | assert result.output.strip() == "To be implemented!" 45 | -------------------------------------------------------------------------------- /scripts/pre_commit_generate_cli_help.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Licensed to the Apache Software Foundation (ASF) under one 3 | # or more contributor license agreements. See the NOTICE file 4 | # distributed with this work for additional information 5 | # regarding copyright ownership. The ASF licenses this file 6 | # to you under the Apache License, Version 2.0 (the 7 | # "License"); you may not use this file except in compliance 8 | # with the License. You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, 13 | # software distributed under the License is distributed on an 14 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | # KIND, either express or implied. See the License for the 16 | # specific language governing permissions and limitations 17 | # under the License. 18 | 19 | set -euo pipefail 20 | 21 | MY_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 22 | TMP_FILE=$(mktemp) 23 | TMP_OUTPUT=$(mktemp) 24 | 25 | cd "${MY_DIR}/../" || exit; 26 | 27 | echo "\`\`\`" >"${TMP_FILE}" 28 | 29 | export MAX_SCREEN_WIDTH=100 30 | export FORCE_SCREEN_WIDTH="true" 31 | export VERBOSE="true" 32 | 33 | kibble --help | sed 's/^/ /' | sed 's/ *$//' >>"${TMP_FILE}" 34 | 35 | echo "\`\`\`" >> "${TMP_FILE}" 36 | 37 | MAX_LEN=$(awk '{ print length($0); }' "${TMP_FILE}" | sort -n | tail -1 ) 38 | 39 | README_FILE="${MY_DIR}/../README.md" 40 | 41 | LEAD='^$' 42 | TAIL='^$' 43 | 44 | BEGIN_GEN=$(grep -n "${LEAD}" <"${README_FILE}" | sed 's/\(.*\):.*/\1/g') 45 | END_GEN=$(grep -n "${TAIL}" <"${README_FILE}" | sed 's/\(.*\):.*/\1/g') 46 | cat <(head -n "${BEGIN_GEN}" "${README_FILE}") \ 47 | "${TMP_FILE}" \ 48 | <(tail -n +"${END_GEN}" "${README_FILE}") \ 49 | >"${TMP_OUTPUT}" 50 | 51 | mv "${TMP_OUTPUT}" "${README_FILE}" 52 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 19 | 20 |
