Skip to content

Commit

Permalink
Merge pull request #150 from ibis-ssl/refactor/pre-commit
Browse files Browse the repository at this point in the history
pre-commit色々
  • Loading branch information
HansRobo authored Feb 20, 2024
2 parents 0d84dbd + 0250cfe commit 025ac9b
Show file tree
Hide file tree
Showing 157 changed files with 1,198 additions and 1,193 deletions.
1 change: 0 additions & 1 deletion .clang-format
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
---
Language: Cpp
BasedOnStyle: Google

Expand Down
16 changes: 7 additions & 9 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "" # See documentation for possible values
directory: "/" # Location of package manifests
- package-ecosystem: github-actions
directory: /
schedule:
interval: "weekly"

interval: daily
open-pull-requests-limit: 1
labels:
- tag:bot
- type:github-actions
16 changes: 7 additions & 9 deletions .github/workflows/build_test.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
---
name: build test

on:
workflow_dispatch:
pull_request:
paths:
- '.github/workflows/build-test.yml'
- '**/**.cpp'
- '**/**.h'
- '**/**.hpp'
- '**/CMakeLists.txt'
- '**/package.xml'
- .github/workflows/build-test.yml
- "**/**.cpp"
- "**/**.h"
- "**/**.hpp"
- "**/CMakeLists.txt"
- "**/package.xml"
merge_group:


jobs:
job:
name: BuildAndRun
Expand Down Expand Up @@ -75,7 +73,7 @@ jobs:

- name: Setup Problem Matchers for clang-format
run: echo "::add-matcher::${{ github.workspace }}/.github/matchers/clang-format.json"

- name: Show test result
if: always()
run: |
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/custom_dict.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
{
"ignorePaths": [
"**/**.ui"
],
"ignorePaths": ["**/**.ui"],
"words": [
"grSim",
"robocup",
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/sync_doc.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
---
name: sync docs
on:
push:
branches:
- develop
- master
paths:
- "docs/**"
- docs/**

workflow_dispatch:

Expand Down
35 changes: 0 additions & 35 deletions .gitlab-ci.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/codeStyles/codeStyleConfig.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/crane.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/dictionaries/hans.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions .markdownlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
default: true
MD013: false
MD024:
siblings_only: true
MD029:
style: ordered
MD033: false
MD041: false
MD046: false
MD049: false
21 changes: 10 additions & 11 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
---
ci:
autofix_commit_msg: "style(pre-commit): autofix"

Expand All @@ -24,10 +23,10 @@ repos:
- id: markdownlint
args: [-c, .markdownlint.yaml, --fix]

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.0-alpha.6
hooks:
- id: prettier
# - repo: https://github.com/pre-commit/mirrors-prettier
# rev: v3.0.0-alpha.6
# hooks:
# - id: prettier

- repo: https://github.com/adrienverge/yamllint
rev: v1.30.0
Expand All @@ -37,7 +36,7 @@ repos:
- repo: https://github.com/tier4/pre-commit-hooks-ros
rev: v0.8.0
hooks:
- id: flake8-ros
# - id: flake8-ros
- id: prettier-xacro
- id: prettier-launch-xml
- id: prettier-package-xml
Expand All @@ -55,16 +54,16 @@ repos:
- id: shfmt
args: [-w, -s, -i=4]

- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
# - repo: https://github.com/pycqa/isort
# rev: 5.12.0
# hooks:
# - id: isort

- repo: https://github.com/psf/black
rev: 23.3.0
hooks:
- id: black
args: [--line-length=100]
args: [--line-length=99]

- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v16.0.0
Expand Down
34 changes: 17 additions & 17 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"python.autoComplete.extraPaths": [
"/home/hans/workspace/ibis_ws/install/robocup_ssl_msgs/local/lib/python3.10/dist-packages",
"/home/hans/workspace/ibis_ws/install/crane_msgs/local/lib/python3.10/dist-packages",
"/home/hans/workspace/ibis_ws/install/crane_description/local/lib/python3.10/dist-packages",
"/home/hans/workspace/ibis_ws/install/consai_visualizer/local/lib/python3.10/dist-packages",
"/opt/ros/humble/lib/python3.10/site-packages",
"/opt/ros/humble/local/lib/python3.10/dist-packages"
],
"python.analysis.extraPaths": [
"/home/hans/workspace/ibis_ws/install/robocup_ssl_msgs/local/lib/python3.10/dist-packages",
"/home/hans/workspace/ibis_ws/install/crane_msgs/local/lib/python3.10/dist-packages",
"/home/hans/workspace/ibis_ws/install/crane_description/local/lib/python3.10/dist-packages",
"/home/hans/workspace/ibis_ws/install/consai_visualizer/local/lib/python3.10/dist-packages",
"/opt/ros/humble/lib/python3.10/site-packages",
"/opt/ros/humble/local/lib/python3.10/dist-packages"
]
}
"python.autoComplete.extraPaths": [
"/home/hans/workspace/ibis_ws/install/robocup_ssl_msgs/local/lib/python3.10/dist-packages",
"/home/hans/workspace/ibis_ws/install/crane_msgs/local/lib/python3.10/dist-packages",
"/home/hans/workspace/ibis_ws/install/crane_description/local/lib/python3.10/dist-packages",
"/home/hans/workspace/ibis_ws/install/consai_visualizer/local/lib/python3.10/dist-packages",
"/opt/ros/humble/lib/python3.10/site-packages",
"/opt/ros/humble/local/lib/python3.10/dist-packages"
],
"python.analysis.extraPaths": [
"/home/hans/workspace/ibis_ws/install/robocup_ssl_msgs/local/lib/python3.10/dist-packages",
"/home/hans/workspace/ibis_ws/install/crane_msgs/local/lib/python3.10/dist-packages",
"/home/hans/workspace/ibis_ws/install/crane_description/local/lib/python3.10/dist-packages",
"/home/hans/workspace/ibis_ws/install/consai_visualizer/local/lib/python3.10/dist-packages",
"/opt/ros/humble/lib/python3.10/site-packages",
"/opt/ros/humble/local/lib/python3.10/dist-packages"
]
}
22 changes: 22 additions & 0 deletions .yamllint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
extends: default

ignore: |
*.param.yaml
rules:
braces:
level: error
max-spaces-inside: 1 # To format with Prettier
comments:
level: error
min-spaces-from-content: 1 # To be compatible with C++ and Python
document-start:
level: error
present: false # Don't need document start markers
line-length: disable # Delegate to Prettier
truthy:
level: error
check-keys: false # To allow 'on' of GitHub Actions
quoted-strings:
level: error
required: only-when-needed # To keep consistent style
15 changes: 15 additions & 0 deletions CPPLINT.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Modified from https://github.com/ament/ament_lint/blob/ebd524bb9973d5ec1dc48a670ce54f958a5a0243/ament_cpplint/ament_cpplint/main.py#L64-L120
set noparent
linelength=100
includeorder=standardcfirst
filter=-build/c++11 # we do allow C++11
filter=-build/namespaces_literals # we allow using namespace for literals
filter=-runtime/references # we consider passing non-const references to be ok
filter=-whitespace/braces # we wrap open curly braces for namespaces, classes and functions
filter=-whitespace/indent # we don't indent keywords like public, protected and private with one space
filter=-whitespace/parens # we allow closing parenthesis to be on the next line
filter=-whitespace/semicolon # we allow the developer to decide about whitespace after a semicolon
filter=-build/header_guard # we automatically fix the names of header guards using pre-commit
filter=-build/include_order # we use the custom include order
filter=-build/include_subdir # we allow the style of "foo.hpp"
filter=-readability/alt_tokens # we want to use not instead of !
2 changes: 1 addition & 1 deletion consai_ros2/consai_vision_tracker/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@

<buildtool_depend>ament_cmake_auto</buildtool_depend>

<depend>consai_visualizer_msgs</depend>
<depend>launch_ros</depend>
<depend>liborocos-bfl</depend>
<depend>pkg-config</depend>
<depend>rclcpp</depend>
<depend>rclcpp_components</depend>
<depend>robocup_ssl_msgs</depend>
<depend>consai_visualizer_msgs</depend>

<test_depend>ament_lint_auto</test_depend>
<test_depend>crane_lint_common</test_depend>
Expand Down
3 changes: 1 addition & 2 deletions consai_ros2/consai_vision_tracker/src/tracker_component.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,14 @@

#include "robocup_ssl_msgs/msg/robot_id.hpp"

using namespace std::chrono_literals;

namespace consai_vision_tracker
{
using RobotId = robocup_ssl_msgs::msg::RobotId;
using std::placeholders::_1;

Tracker::Tracker(const rclcpp::NodeOptions & options) : Node("tracker", options)
{
using std::chrono::operator""s;
const auto UPDATE_RATE = 0.01s;

ball_tracker = std::make_shared<BallTracker>(UPDATE_RATE.count());
Expand Down
Loading

0 comments on commit 025ac9b

Please sign in to comment.