Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom autocoders #1558

Merged
merged 3 commits into from
Jul 20, 2022
Merged

Custom autocoders #1558

merged 3 commits into from
Jul 20, 2022

Conversation

legounicycler
Copy link

Originating Project/Creator SRL MCFSW
Affected Component N/A
Affected Architectures(s) FPrime autocoders
Related Issue(s) N/A
Has Unit Tests (y/n) n
Builds Without Errors (y/n) y
Unit Tests Pass (y/n) N/A
Documentation Included (y/n) n

Change Description

  1. Changes to the API.cmake and build.cmake files which enable custom autocoders to be registered
  2. Small typo fix in the target-integration.md file

Rationale

Projects like SRL need custom fpp autocoders, so these changes enable this.

Testing/Review Recommendations

Check that this commit passes CI

Future Work

Update/create custom autocoder documentation

@github-actions
Copy link

github-actions bot commented Jul 8, 2022

@check-spelling-bot Report

Unrecognized words, please review:

  • AUTOCOER
Previously acknowledged words that are now absent aadl aarondou Accu adoc alignedallocator asciidoctor autodetect autonumbering awt bavail bbd bc bithacks BLSP bootup capout chown cinttypes Classloader classpath compat componentaction compositestructures compxml concat configurator creatingdocsetswithdoxygen deserializer Dinstall dll doall Donatas donsim Doubek ecore eps errstr esac foundin fprim FPRIMEPROTOCOL getenv gethostbyname getmtime getppid gettempdir gmail Gnd GNDIF groupadd groupmod GTestbase hdp HOMEPAGE hostent HWriter ifchange IFXML IJET includefile inorder INSTALLDIR instanceof interoperability Inttype isfgen isfpluginexec isfxmlwriter itcl javabuilder javac javanature javax jdt jf JFile jmi JOption junit kevensen longdesc magicdraw mcternan mdbasiccomponents mdinternalstructures mdkernel mdports mdprofiles mdxml mdzip memoization memoize metadata mngr mpmcs mscgen nasafprime netdb Netscape's NGAT nh nio nomagic nondetached nroff OMG's openjdk OS'es ovrTrace peeker placeholders PLUGINDIR ppid Prepends println propvals PROTOCOLINTERFACE Pymodule PYPI refman RHEL RPISCHEDCONTEXTS saikiranra seander Simkunas SOCKETIPDRIVERTYPES SQL's sramanan startword strcat strcpy Stringify submenu tcl templating testhpp Testname textui tkgui tmpd tmpdir toclevels toolbar ubuntu uk ul uml urllib useradd usermod ve virtualenv vmsize vn watney workaround workspaces Xmx Xss Xvfb
Some files were were automatically ignored

These sample patterns would exclude them:

^Drv/BlockDriver/BlockDriver\.hpp$
^Drv/LinuxGpioDriver/LinuxGpioDriver\.hpp$
^Drv/LinuxSpiDriver/LinuxSpiDriver\.hpp$
^Drv/TcpClient/TcpClient\.hpp$
^Fw/Types/Linux/StandardTypes\.hpp$
^Svc/LinuxTime/LinuxTime\.hpp$
^Svc/PrmDb/PrmDb\.hpp$
^Svc/TlmChan/TlmChan\.hpp$
^requirements\.txt$

You should consider adding them to:

.github/actions/spelling/excludes.txt

File matching is via Perl regular expressions.

To check these files, more of their words need to be in the dictionary than not. You can use patterns.txt to exclude portions, add items to the dictionary (e.g. by adding them to allow.txt), or fix typos.

To accept these unrecognized words as correct (and remove the previously acknowledged and now absent words), run the following commands

... in a clone of the git@github.com:legounicycler/fprime.git repository
on the custom_autocoder branch:

update_files() {
perl -e '
my @expect_files=qw('".github/actions/spelling/expect.txt"');
@ARGV=@expect_files;
my @stale=qw('"$patch_remove"');
my $re=join "|", @stale;
my $suffix=".".time();
my $previous="";
sub maybe_unlink { unlink($_[0]) if $_[0]; }
while (<>) {
if ($ARGV ne $old_argv) { maybe_unlink($previous); $previous="$ARGV$suffix"; rename($ARGV, $previous); open(ARGV_OUT, ">$ARGV"); select(ARGV_OUT); $old_argv = $ARGV; }
next if /^(?:$re)(?:(?:\r|\n)*$| .*)/; print;
}; maybe_unlink($previous);'
perl -e '
my $new_expect_file=".github/actions/spelling/expect.txt";
use File::Path qw(make_path);
use File::Basename qw(dirname);
make_path (dirname($new_expect_file));
open FILE, q{<}, $new_expect_file; chomp(my @words = <FILE>); close FILE;
my @add=qw('"$patch_add"');
my %items; @items{@words} = @words x (1); @items{@add} = @add x (1);
@words = sort {lc($a)."-".$a cmp lc($b)."-".$b} keys %items;
open FILE, q{>}, $new_expect_file; for my $word (@words) { print FILE "$word\n" if $word =~ /\w/; };
close FILE;
system("git", "add", $new_expect_file);
'
(cat '.github/actions/spelling/excludes.txt' - <<EOF
$should_exclude_patterns
EOF
) |grep .|
sort -f |
uniq > '.github/actions/spelling/excludes.txt.temp' &&
mv '.github/actions/spelling/excludes.txt.temp' '.github/actions/spelling/excludes.txt'
}

comment_json=$(mktemp)
curl -L -s -S \
  --header "Content-Type: application/json" \
  "https://api.github.com/repos/nasa/fprime/issues/comments/1178395133" > "$comment_json"
comment_body=$(mktemp)
jq -r .body < "$comment_json" > $comment_body
rm $comment_json

patch_remove=$(perl -ne 'next unless s{^</summary>(.*)</details>$}{$1}; print' < "$comment_body")
  

patch_add=$(perl -e '$/=undef;
$_=<>;
s{<details>.*}{}s;
s{^#.*}{};
s{\n##.*}{};
s{(?:^|\n)\s*\*}{}g;
s{\s+}{ }g;
print' < "$comment_body")
  

should_exclude_patterns=$(perl -e '$/=undef;
$_=<>;
exit unless s{(?:You should consider excluding directory paths|You should consider adding them to).*}{}s;
s{.*These sample patterns would exclude them:}{}s;
s{.*\`\`\`([^`]*)\`\`\`.*}{$1}m;
print' < "$comment_body" | grep . || true)

update_files
rm $comment_body
git add -u

cmake/API.cmake Outdated Show resolved Hide resolved
cmake/API.cmake Outdated Show resolved Hide resolved
cmake/target/build.cmake Outdated Show resolved Hide resolved
@LeStarch LeStarch merged commit e734c98 into nasa:devel Jul 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants