Skip to content

Commit 72f1c7e

Browse files
committed
Apply ReplaceWithPrimitiveNil to lib/truffle as well
* Also add Primitive.interop_null?
1 parent d3f7862 commit 72f1c7e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+128
-40
lines changed

.rubocop.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ AllCops:
1212
Exclude:
1313
- 'lib/truffle/date/format.rb' # crashes Rubocop in VariableForce
1414
- 'lib/truffle/date/delta/parser.rb' # generated code
15+
- 'lib/truffle/pathname.rb' # from upstream and should be upstreamed
1516
- 'lib/truffle/socket/mri.rb' # taken from MRI
1617
- 'lib/truffle/ffi/**/*.rb' # taken from FFI gem
1718
- 'src/main/ruby/truffleruby/core/truffle/ffi/pointer_extra.rb' # taken from FFI gem
@@ -401,6 +402,7 @@ Layout/SpaceAroundEqualsInParameterDefault:
401402
TruffleRuby/ReplaceWithPrimitiveNil:
402403
Enabled: true
403404
Include: # inspect *only* this directory
405+
- lib/truffle/**/*.rb
404406
- src/main/ruby/**/*.rb
405407

406408
# Supports --auto-correct

lib/cext/ABI_check.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
5
1+
6

lib/truffle/continuation.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# truffleruby_primitives: true
2+
13
# Copyright (c) 2017, 2023 Oracle and/or its affiliates. All rights reserved. This
24
# code is released under a tri EPL/GPL/LGPL license. You can use it,
35
# redistribute it and/or modify it under the terms of the:

lib/truffle/coverage.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# truffleruby_primitives: true
2+
13
# Copyright (c) 2015, 2023 Oracle and/or its affiliates. All rights reserved. This
24
# code is released under a tri EPL/GPL/LGPL license. You can use it,
35
# redistribute it and/or modify it under the terms of the:

lib/truffle/digest/bubblebabble.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# truffleruby_primitives: true
2+
13
# Copyright (c) 2015, 2023 Oracle and/or its affiliates. All rights reserved. This
24
# code is released under a tri EPL/GPL/LGPL license. You can use it,
35
# redistribute it and/or modify it under the terms of the:

lib/truffle/fcntl.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# truffleruby_primitives: true
2+
13
# Copyright (c) 2015, 2023 Oracle and/or its affiliates. All rights reserved. This
24
# code is released under a tri EPL/GPL/LGPL license. You can use it,
35
# redistribute it and/or modify it under the terms of the:

lib/truffle/ffi.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# truffleruby_primitives: true
2+
13
# Copyright (c) 2017, 2019 Oracle and/or its affiliates. All rights reserved. This
24
# code is released under a tri EPL/GPL/LGPL license. You can use it,
35
# redistribute it and/or modify it under the terms of the:

lib/truffle/objspace.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def self.count_nodes_method(method, nodes)
1414

1515
until node_stack.empty?
1616
node = node_stack.pop
17-
next if node.nil?
17+
next if Primitive.nil?(node)
1818

1919
name = node.first
2020
children = node.drop(1)

lib/truffle/pathname.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# truffleruby_primitives: true
2-
#
2+
33
# = pathname.rb
44
#
55
# Object-Oriented Pathname Class

lib/truffle/rbconfig.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# truffleruby_primitives: true
21
# frozen-string-literal: false
3-
#
2+
# truffleruby_primitives: true
3+
44
# Copyright (c) 2014, 2023 Oracle and/or its affiliates. All rights reserved. This
55
# code is released under a tri EPL/GPL/LGPL license. You can use it,
66
# redistribute it and/or modify it under the terms of the:

0 commit comments

Comments
 (0)