Skip to content

Commit

Permalink
Fix formatting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
tylerjw authored and rhaschke committed Mar 25, 2021
1 parent 3b9977d commit b618bac
Show file tree
Hide file tree
Showing 101 changed files with 2,324 additions and 1,185 deletions.
1 change: 0 additions & 1 deletion .docker/source/Dockerfile
Expand Up @@ -31,4 +31,3 @@ RUN cd .. && \

# Environment variable used in instructions on moveit.ros.org website for running clang-tidy
ENV CATKIN_WS /root/ws_moveit

4 changes: 2 additions & 2 deletions CODE_OF_CONDUCT.md
Expand Up @@ -2,11 +2,11 @@

Like the technical community as a whole, the MoveIt team and community is made up of a mixture of professionals and volunteers from all over the world, working on every aspect of the mission - including mentorship, teaching, and connecting people.

Diversity is one of our huge strengths, but it can also lead to communication issues and unhappiness. To that end, we have a few basic rules that we ask people to adhere to. This code applies equally to maintainers, contributors, and those seeking help and guidance.
Diversity is one of our huge strengths, but it can also lead to communication issues and unhappiness. To that end, we have a few basic rules that we ask people to adhere to. This code applies equally to maintainers, contributors, and those seeking help and guidance.
It applies to all kinds of communication, including discussions on GitHub (issue tracker, pull requests), MoveIt maintainer meetings and any other forums created by the project team, which the community uses for communication.

- **Be friendly and patient.**
- **Be welcoming.** We strive to be a community that welcomes and supports people of all backgrounds and identities.
- **Be welcoming.** We strive to be a community that welcomes and supports people of all backgrounds and identities.
- **Be considerate.** Your work will be used by other people, and you in turn will depend on the work of others. Any decision you take will affect users and colleagues, and you should take those consequences into account when making decisions. Remember that we're a world-wide community, so you might not be communicating in someone else's primary language.
- **Be respectful.** Not all of us will agree all the time, but disagreement is no excuse for poor behavior and poor manners. We might all experience some frustration now and then, but we cannot allow that frustration to turn into a personal attack. It's important to remember that a community where people feel uncomfortable or threatened is not a productive one. Members of the MoveIt community should be respectful when dealing with other members as well as with people outside the MoveIt community.
- **Be careful in the words that you choose.** We are a community of professionals, and we conduct ourselves professionally. Be kind to others. Do not insult or put down other participants. Harassment and other exclusionary behavior aren't acceptable. Treat others like you want to be treated.
Expand Down
124 changes: 88 additions & 36 deletions moveit/scripts/create_maintainer_table.py
Expand Up @@ -8,80 +8,129 @@
import webbrowser
from catkin_pkg.packages import find_packages

maintainers_dict = {"Ioan Sucan" : "isucan",
"Michael Ferguson" : "mikeferguson",
"Sachin Chitta" : "sachinchitta",
"G.A. vd. Hoorn" : "gavanderhoorn",
"Dave Coleman" : "davetcoleman",
"Acorn Pooley" : "acorn",
"Jon Binney" : "jonbinney",
"Matei Ciocarlie" : "mateiciocarlie",
"Michael Görner".decode('utf8') : "v4hn",
"Robert Haschke" : "rhaschke",
"Ian McMahon" : "IanTheEngineer",
"Isaac I. Y. Saito" : "130s",
"Mathias Lüdtke".decode('utf8') : "ipa-mdl",
"Ryan Luna" : "ryanluna",
"Chittaranjan Srinivas Swaminathan" : "ksatyaki",
"Chittaranjan S Srinivas" : "ksatyaki"
maintainers_dict = {
"Ioan Sucan": "isucan",
"Michael Ferguson": "mikeferguson",
"Sachin Chitta": "sachinchitta",
"G.A. vd. Hoorn": "gavanderhoorn",
"Dave Coleman": "davetcoleman",
"Acorn Pooley": "acorn",
"Jon Binney": "jonbinney",
"Matei Ciocarlie": "mateiciocarlie",
"Michael Görner".decode("utf8"): "v4hn",
"Robert Haschke": "rhaschke",
"Ian McMahon": "IanTheEngineer",
"Isaac I. Y. Saito": "130s",
"Mathias Lüdtke".decode("utf8"): "ipa-mdl",
"Ryan Luna": "ryanluna",
"Chittaranjan Srinivas Swaminathan": "ksatyaki",
"Chittaranjan S Srinivas": "ksatyaki",
}


def eprint(*args, **kwargs):
print(*args, file=sys.stderr, **kwargs)


def author_to_github(maintainer):
try:
name = maintainers_dict[maintainer.name]
except KeyError:
eprint( "Missing maintainer: ", maintainer.name)
eprint("Missing maintainer: ", maintainer.name)
name = maintainer.email
return name


def template_file(src, dst, subs):
print("++ Templating '{0}'".format(src))
with open(src, 'r') as f:
with open(src, "r") as f:
data = f.read()
for k, v in subs.items():
data = data.replace(k, v)
with open(dst, 'w+') as f:
with open(dst, "w+") as f:
f.write(data)
print("++ Webpage ready at '{0}'".format(dst))
webbrowser.open(dst)


def create_travis_badge(package_name):
output = ''
output = ""
# Indigo
output += "<td>"
output += "<a href='http://build.ros.org/view/Isrc_uT/job/Isrc_uT__" + package_name + "__ubuntu_trusty__source/'><img src='http://build.ros.org/buildStatus/icon?job=Isrc_uT__" + package_name + "__ubuntu_trusty__source'></a>"
output += (
"<a href='http://build.ros.org/view/Isrc_uT/job/Isrc_uT__"
+ package_name
+ "__ubuntu_trusty__source/'><img src='http://build.ros.org/buildStatus/icon?job=Isrc_uT__"
+ package_name
+ "__ubuntu_trusty__source'></a>"
)
output += "</td><td>"
output += "<a href='http://build.ros.org/view/Ibin_uT64/job/Ibin_uT64__" + package_name + "__ubuntu_trusty_amd64__binary/'><img src='http://build.ros.org/buildStatus/icon?job=Ibin_uT64__" + package_name + "__ubuntu_trusty_amd64__binary'></a>"
output += (
"<a href='http://build.ros.org/view/Ibin_uT64/job/Ibin_uT64__"
+ package_name
+ "__ubuntu_trusty_amd64__binary/'><img src='http://build.ros.org/buildStatus/icon?job=Ibin_uT64__"
+ package_name
+ "__ubuntu_trusty_amd64__binary'></a>"
)
output += "</td>"

# Jade
output += "<td>"
output += "<a href='http://build.ros.org/view/Jsrc_uT/job/Jsrc_uT__" + package_name + "__ubuntu_trusty__source/'><img src='http://build.ros.org/buildStatus/icon?job=Jsrc_uT__" + package_name + "__ubuntu_trusty__source'></a>"
output += (
"<a href='http://build.ros.org/view/Jsrc_uT/job/Jsrc_uT__"
+ package_name
+ "__ubuntu_trusty__source/'><img src='http://build.ros.org/buildStatus/icon?job=Jsrc_uT__"
+ package_name
+ "__ubuntu_trusty__source'></a>"
)
output += "</td><td>"
output += "<a href='http://build.ros.org/view/Jbin_uT64/job/Jbin_uT64__" + package_name + "__ubuntu_trusty_amd64__binary/'><img src='http://build.ros.org/buildStatus/icon?job=Jbin_uT64__" + package_name + "__ubuntu_trusty_amd64__binary'></a>"
output += (
"<a href='http://build.ros.org/view/Jbin_uT64/job/Jbin_uT64__"
+ package_name
+ "__ubuntu_trusty_amd64__binary/'><img src='http://build.ros.org/buildStatus/icon?job=Jbin_uT64__"
+ package_name
+ "__ubuntu_trusty_amd64__binary'></a>"
)
output += "</td>"

# Kinetic
output += "<td>"
output += "<a href='http://build.ros.org/view/Ksrc_uX/job/Ksrc_uX__" + package_name + "__ubuntu_xenial__source/'><img src='http://build.ros.org/buildStatus/icon?job=Ksrc_uX__" + package_name + "__ubuntu_xenial__source'></a>"
output += (
"<a href='http://build.ros.org/view/Ksrc_uX/job/Ksrc_uX__"
+ package_name
+ "__ubuntu_xenial__source/'><img src='http://build.ros.org/buildStatus/icon?job=Ksrc_uX__"
+ package_name
+ "__ubuntu_xenial__source'></a>"
)
output += "</td><td>"
output += "<a href='http://build.ros.org/view/Kbin_uX64/job/Kbin_uX64__" + package_name + "__ubuntu_xenial_amd64__binary/'><img src='http://build.ros.org/buildStatus/icon?job=Kbin_uX64__" + package_name + "__ubuntu_xenial_amd64__binary'></a>"
output += (
"<a href='http://build.ros.org/view/Kbin_uX64/job/Kbin_uX64__"
+ package_name
+ "__ubuntu_xenial_amd64__binary/'><img src='http://build.ros.org/buildStatus/icon?job=Kbin_uX64__"
+ package_name
+ "__ubuntu_xenial_amd64__binary'></a>"
)
output += "</td>"
return output

def get_first_folder(path) :
head,tail = os.path.split(path)

def get_first_folder(path):
head, tail = os.path.split(path)
components = []
while len(tail)>0:
components.insert(0,tail)
head,tail = os.path.split(head)
while len(tail) > 0:
components.insert(0, tail)
head, tail = os.path.split(head)
return components[0]


def populate_package_data(path, package):
output = "<td><a href='https://github.com/ros-planning/" + get_first_folder(path) + "'>" + package.name + "</a></td>"
output = (
"<td><a href='https://github.com/ros-planning/"
+ get_first_folder(path)
+ "'>"
+ package.name
+ "</a></td>"
)
output += "<td>" + package.version + "</td>"
output += "<td>"
first = True
Expand All @@ -96,11 +145,12 @@ def populate_package_data(path, package):
output += create_travis_badge(package.name)
return output


def list_moveit_packages():
"""
Creates MoveIt List
"""
output = ''
output = ""
packages = find_packages(os.getcwd())

for path, package in packages.items():
Expand All @@ -110,9 +160,11 @@ def list_moveit_packages():

# Save to file
basepath = os.path.dirname(os.path.realpath(__file__))
template_file(os.path.join(basepath, 'maintainer_table_template.html'),
os.path.join(basepath, 'index.html'),
{'CONTENTS' : output})
template_file(
os.path.join(basepath, "maintainer_table_template.html"),
os.path.join(basepath, "index.html"),
{"CONTENTS": output},
)


if __name__ == "__main__":
Expand Down
80 changes: 52 additions & 28 deletions moveit/scripts/create_readme_table.py
Expand Up @@ -8,46 +8,63 @@
import catkin_pkg
from catkin_pkg.packages import find_packages


def create_header(ros_ubuntu_dict):
ros_distros = sorted(ros_ubuntu_dict.keys())
section_header = "### ROS Buildfarm\n"
header="MoveIt Package"
header_lines = '-'*len(header)
for ros in ros_distros:
source = ' '.join([ros.capitalize(), "Source"])
debian = ' '.join([ros.capitalize(), "Debian"])
header = ' | '.join([header, source, debian])
header_lines = ' | '.join([header_lines, '-'*len(source), '-'*len(debian)])
return '\n'.join([section_header, header, header_lines])
ros_distros = sorted(ros_ubuntu_dict.keys())
section_header = "### ROS Buildfarm\n"
header = "MoveIt Package"
header_lines = "-" * len(header)
for ros in ros_distros:
source = " ".join([ros.capitalize(), "Source"])
debian = " ".join([ros.capitalize(), "Debian"])
header = " | ".join([header, source, debian])
header_lines = " | ".join([header_lines, "-" * len(source), "-" * len(debian)])
return "\n".join([section_header, header, header_lines])


def define_urls(target, params):
if target == 'src':
params['job'] = "{R}src_u{U}__{package}__ubuntu_{ubuntu}__source".format(**params)
params['url'] = "{base_url}/view/{R}src_u{U}/job/{job}".format(**params)
elif target == 'bin':
params['job'] = "{R}bin_u{U}64__{package}__ubuntu_{ubuntu}_amd64__binary".format(**params)
params['url'] = "{base_url}/view/{R}bin_u{U}64/job/{job}".format(**params)
if target == "src":
params["job"] = "{R}src_u{U}__{package}__ubuntu_{ubuntu}__source".format(
**params
)
params["url"] = "{base_url}/view/{R}src_u{U}/job/{job}".format(**params)
elif target == "bin":
params[
"job"
] = "{R}bin_u{U}64__{package}__ubuntu_{ubuntu}_amd64__binary".format(**params)
params["url"] = "{base_url}/view/{R}bin_u{U}64/job/{job}".format(**params)


def create_line(package, ros_ubuntu_dict):
ros_distros = sorted(ros_ubuntu_dict.keys())
line = '\n' + package
line = "\n" + package
print(package, file=sys.stderr)
for ros in ros_distros:
ubuntu = ros_ubuntu_dict[ros]
params = dict(R=ros[0].upper(), U=ubuntu[0].upper(), ubuntu=ubuntu.lower(),
package=package, base_url="http://build.ros.org")
for target in ['src', 'bin']:
params = dict(
R=ros[0].upper(),
U=ubuntu[0].upper(),
ubuntu=ubuntu.lower(),
package=package,
base_url="http://build.ros.org",
)
for target in ["src", "bin"]:
define_urls(target, params)
response = requests.get(params['url']).status_code
response = requests.get(params["url"]).status_code
# we want to show a particular OS's badges to indicate they are not released / working yet
if response < 400 or ubuntu == "focal": # success
line += ' | [![Build Status]({base_url}/buildStatus/icon?job={job})]({url})'.format(**params)
line += " | [![Build Status]({base_url}/buildStatus/icon?job={job})]({url})".format(
**params
)
else: # error
line += ' | '
print(' {}: {} {}'.format(ros, response, params['url']), file=sys.stderr)
line += " | "
print(
" {}: {} {}".format(ros, response, params["url"]), file=sys.stderr
)

return line


def create_moveit_buildfarm_table():
"""
Creates MoveIt buildfarm badge table
Expand All @@ -56,22 +73,29 @@ def create_moveit_buildfarm_table():
# combinations for supported distribitions. For instance, in Noetic,
# remove {"indigo":"trusty"} and add {"noetic":"fbuntu"} with "fbuntu"
# being whatever the 20.04 distro is named
supported_distro_ubuntu_dict = {"kinetic":"xenial", "melodic":"bionic", "noetic":"focal"}
supported_distro_ubuntu_dict = {
"kinetic": "xenial",
"melodic": "bionic",
"noetic": "focal",
}

all_packages = sorted([package.name for _, package in find_packages(os.getcwd()).items()])
all_packages = sorted(
[package.name for _, package in find_packages(os.getcwd()).items()]
)
moveit_packages = list()
other_packages = list()
for package in all_packages:
if package.startswith('moveit'):
if package.startswith("moveit"):
moveit_packages.append(package)
else:
other_packages.append(package)
moveit_packages.extend(other_packages)

buildfarm_table = create_header(supported_distro_ubuntu_dict)
for package in moveit_packages:
buildfarm_table += create_line(package, supported_distro_ubuntu_dict)
buildfarm_table += create_line(package, supported_distro_ubuntu_dict)
print(buildfarm_table)


if __name__ == "__main__":
sys.exit(create_moveit_buildfarm_table())

0 comments on commit b618bac

Please sign in to comment.