Skip to content

Commit

Permalink
Merge pull request #2 from yui-knk/github_actions
Browse files Browse the repository at this point in the history
Add check-misc job to CI
  • Loading branch information
yui-knk authored Jul 4, 2024
2 parents f195d44 + f9c9a75 commit be40274
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 3 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: test

on:
push:
pull_request:

permissions:
contents: read

jobs:
check-misc:
runs-on: ubuntu-20.04
strategy:
matrix:
ruby: ['head']
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- run: bundle install

# Copy from https://github.com/ruby/ruby/blob/cb9a47f2acd6e373ef868b890a9d07da6f565dd4/.github/workflows/check_misc.yml#L31
- name: Check if C-sources are US-ASCII
run: |
grep -r -n --include='*.[chyS]' --include='*.asm' $'[^\t-~]' -- . && exit 1 || :
# Copy from https://github.com/ruby/ruby/blob/089227e94823542acfdafa68541d330eee42ffea/.github/workflows/check_misc.yml#L27
- name: Check for trailing spaces
run: |
git grep -I -n '[ ]$' -- '*.rb' '*.[chy]' '*.rs' ':!spec/' && exit 1 || :
git grep -n '^[ ][ ]*$' -- '*.md' && exit 1 || :
6 changes: 3 additions & 3 deletions lib/ast_to_prism/parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ def convert_node(node, block: nil)
exceptions = []
end

# TODO:
# TODO: Change orignal node structures and extract ERRINFO info
if errinfo_assign?(nd_body) # `rescue Err => e` or not
reference = convert_errinfo_assignment(nd_body.children[0])
statements = convert_stmts(nd_body, 1..-1)
Expand Down Expand Up @@ -788,7 +788,7 @@ def convert_node(node, block: nil)
nd_vid, = node.children

# TODO: Implement depth

# (source, name, depth, location)
Prism::LocalVariableReadNode.new(source, nd_vid, 0, location(node))
when :IVAR
Expand Down Expand Up @@ -1020,7 +1020,7 @@ def convert_node(node, block: nil)
location(node)
)
when :UNDEF
# TODO:
# TODO: Change original node structures

nd_undef, = node.children
sym = Prism::SymbolNode.new(source, 0, null_location, null_location, null_location, node.children[0], location(node))
Expand Down

0 comments on commit be40274

Please sign in to comment.