I am sorry, arara limits the directive lookup scope to the current document. It would be quite challenging to detect special macros and process them accordingly, like following a file through \input, \include or similar streams. It is really by design.
That's being said, I've been thinking of adding a new feature in the near future called metadirective. That way, we can change the inner workings of the tool itself at runtime. Sorry if it sounds too vague for now, but your question seems to be one of the cases a metadirective could be used for external file reading. I still do not have the faintest idea of how it would be. :)
However, as alephzero mentioned in the comments, correctly parsing TeX would require a TeX engine in itself to resolve nontrivial scenarios. I want arara to be the emacs of the TeX world, but not quite the TeX engine of the TeX world (yet). :) Let me check how things go in the next weeks, so I can work on a new feature draft.
Regarding your scenario, perhaps the --preamble command line flag could be of interest. To quote my lovely user manual that took me a lifetime to write it: :)
Some TeX documents require the same automation steps, e.g, a set of articles. To this end, so as to avoid repeating the same preamble over and over in this specific scenario, arara has the possibility of setting predefined preambles in a special section of the configuration file identified by a unique key for later use. This command line option prepends the predefined preamble referenced by the name key to the current document and then proceeds to extract directives, as usual. For instance:
twopdftex: |
% arara: pdftex
% arara: pdftex
Source file: doc9.tex:
Hello world.
\bye
In this example, we have a preamble named twopdftex and a TeX file named doc9.tex with no directives. Of course, our tool will complain about missing directives, unless we deliberately inject the two directives from the predefined preamble into the current execution:
$ arara -p twopdftex doc9.tex
....
Processing 'doc9.tex' (size: 18 bytes, last modified: 05/29/2018
14:39:21), please wait.
(PDFTeX) PDFTeX engine .................................. SUCCESS
(PDFTeX) PDFTeX engine .................................. SUCCESS
Total: 0.96 seconds
Hope it helps. :)
% arara. – Skillmon Dec 12 '18 at 14:06\inputcan be built from TeX macros, arara would have to contain a complete TeX engine to do this completely. And then somebody is going to want to correctly handle\includes in\if...\ficonstructions, rules in\includefiles taking account of\includeonly, etc - it's probably easiest for the developers to "just say no"! – alephzero Dec 12 '18 at 14:24\@filelistkeeps the heavy lifting within TeX. – StrongBad Dec 12 '18 at 16:31