Skip to content

Commit

Permalink
[cqfn#201] mark puzzles data to use opt-in model feature
Browse files Browse the repository at this point in the history
  • Loading branch information
mbao01 committed Jun 24, 2022
1 parent b8b724f commit 7e2e15a
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,14 @@ pdd --include=src/**/*.py # include only .py files in src/
pdd --include=src/**/* # include all files in src/
```

`` --model ``

Opt-in to use inbuilt ML model to prioritize puzzles found in code.
```bash
pdd --model
pdd -m
```

## How to Format?

Every puzzle has to be formatted like this (pay attention
Expand Down
1 change: 1 addition & 0 deletions assets/puzzles.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ SOFTWARE.
</xs:sequence>
<xs:attribute name="version" use="required" type="xs:string"/>
<xs:attribute name="date" use="required" type="xs:dateTime"/>
<xs:attribute name="model" type="xs:boolean"/>
</xs:complexType>
<xs:unique name="puzzleBody">
<xs:selector xpath="./puzzle"/>
Expand Down
1 change: 1 addition & 0 deletions bin/pdd
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ begin
'-r', '--rule', 'Rule to apply (can be used many times)',
delimiter: ';'
)
o.bool '-m', '--model', 'Opt-in to use ml model to prioritize puzzles'
end
rescue Slop::Error => e
raise StandardError, "#{e.message}, try --help"
Expand Down
2 changes: 1 addition & 1 deletion lib/pdd.rb
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def attrs
'xsi:noNamespaceSchemaLocation' => "#{host('xsd')}/#{PDD::VERSION}.xsd",
'version' => PDD::VERSION,
'date' => Time.now.utc.iso8601
}
}.merge(@opts[:model] ? { 'model' => true } : {})
end

def host(suffix)
Expand Down

0 comments on commit 7e2e15a

Please sign in to comment.