Skip to content
This repository has been archived by the owner on May 6, 2024. It is now read-only.

Commit

Permalink
Further fix pre-commit checks and checked files.
Browse files Browse the repository at this point in the history
  • Loading branch information
Heinrich Kuttler committed Jun 20, 2021
1 parent 2bd281c commit 1cd9ab9
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
8 changes: 8 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,11 @@ repos:
rev: 'v0.6.13'
hooks:
- id: cmake-format
- repo: local
hooks:
- id: clang-format
name: clang-format
description: Format files with clang-format
entry: nle/scripts/run-clang-format
language: system
files: ^(src\/nle|include\/nle|win\/rl)\.(c|cc|cxx|cpp|cu|h|hpp|hxx|cuh|proto)$
7 changes: 4 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,10 @@ file(
add_library(nethack SHARED ${NETHACK_SRC})
add_dependencies(nethack util dat)
set_target_properties(nethack PROPERTIES CXX_STANDARD 14 SUFFIX ".so")
target_include_directories(nethack PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include
${NLE_INC_GEN} /usr/local/include
${CMAKE_CURRENT_SOURCE_DIR}/third_party/libtmt)
target_include_directories(
nethack
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include ${NLE_INC_GEN} /usr/local/include
${CMAKE_CURRENT_SOURCE_DIR}/third_party/libtmt)
target_link_directories(nethack PUBLIC /usr/local/lib)

# Careful with -DMONITOR_HEAP: Ironically, it fails to fclose FILE* heaplog.
Expand Down
2 changes: 1 addition & 1 deletion nle/scripts/run-clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ def print_diff(diff_lines, use_color):
if use_color:
diff_lines = colorize(diff_lines)
if sys.version_info[0] < 3:
sys.stdout.writelines((l.encode("utf-8") for l in diff_lines))
sys.stdout.writelines((line.encode("utf-8") for line in diff_lines))
else:
sys.stdout.writelines(diff_lines)

Expand Down

0 comments on commit 1cd9ab9

Please sign in to comment.